---
title: PATCH /milestones/{id}
slug: content-marketing-platform/api/patch-milestonesid
docTags: 
createdAt: 2026-10-01T18:51:26.265Z
---

{
  "id": "eHqryPlSyA8Bt4pg_vs2W",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "https://api.cmp.optimizely.com/v3/milestones/{id}",
    "servers": [
      {
        "url": "https://api.cmp.optimizely.com/v3/milestones/{id}",
        "description": "v3 version of Optimizely CMP Open API"
      }
    ],
    "name": "PATCH /milestones/{id}",
    "description": "<p>Experimental Updates a milestone. All fields are optional. Only provided fields will be updated. Note: If tasks array is empty, it will remove all task associations for that milestone.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "example": "63f1c2b675be4132854d2741",
          "description": "Unique identifier of the milestone"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Payload to update a milestone",
          "customType": "MilestoneUpdateRequest",
          "schema": [
            {
              "name": "title",
              "kind": "optional",
              "type": "string",
              "nullable": false,
              "description": "Title of the milestone. This should be between 1 and 80 characters.",
              "example": "Q1 Product Launch",
              "minLength": 1,
              "maxLength": 80
            },
            {
              "name": "description",
              "kind": "optional",
              "type": "string",
              "nullable": true,
              "description": "<p>Description of the milestone. If provided, this should be between 1 and 250 characters.</p>",
              "example": "Complete all tasks for the Q1 product launch",
              "minLength": 1,
              "maxLength": 250
            },
            {
              "name": "campaign_id",
              "kind": "optional",
              "type": "string",
              "nullable": false,
              "description": "Id of the campaign to be associated with the milestone",
              "example": "63f1c2b675be4132854d2741"
            },
            {
              "name": "due_date",
              "kind": "optional",
              "type": "string<date-time>",
              "nullable": false,
              "description": "<p>Date and time on which the milestone will expire, in ISO 8601 UTC format</p>",
              "example": "2023-10-07T13:15:30Z",
              "format": "date-time"
            },
            {
              "name": "hex_color",
              "kind": "optional",
              "type": "string",
              "nullable": false,
              "description": "Hex color code for the milestone label",
              "example": "#4ECFD5"
            },
            {
              "name": "tasks",
              "kind": "optional",
              "type": "array",
              "nullable": false,
              "description": "<p>List of tasks to be associated with the milestone. This can be an empty array, but in that case it will remove all task associations for that milestone.</p>",
              "example": "[{\"id\":\"63f1c2b675be4132854d2741\"},{\"id\":\"63f1c2b675be4132854d2742\"}]",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "required",
                  "type": "string",
                  "description": "Task ID"
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/MilestoneUpdateRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "OAuth2",
          "name": "OAuth2",
          "kind": "optional",
          "type": "oauth2",
          "oauth2Flows": {
            "clientCredentials": {
              "tokenUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/token",
              "scopes": {}
            },
            "authorizationCode": {
              "authorizationUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/auth",
              "tokenUrl": "https://accounts.cmp.optimizely.com/o/oauth2/v1/token",
              "scopes": {
                "openid": "Grants the ability to receive a unique identifier for the user.",
                "profile": "Grants access to user profile information.",
                "offline_access": "Grants the ability to refresh access_token using the refresh token even when user is not present (not logged in)."
              }
            }
          },
          "requiredScopes": [
            "openid",
            "profile",
            "offline_access"
          ]
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Updated milestone",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "MilestoneResponse",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier of the milestone",
                "example": "63f1c2b675be4132854d2741"
              },
              {
                "name": "title",
                "kind": "required",
                "type": "string",
                "description": "Title of the milestone",
                "example": "Sample Milestone"
              },
              {
                "name": "color",
                "kind": "required",
                "type": "string",
                "description": "Color of the milestone label",
                "example": "#4ECFD5"
              },
              {
                "name": "description",
                "kind": "required",
                "type": "string",
                "nullable": true,
                "description": "Description of the milestone",
                "example": "This is a milestone"
              },
              {
                "name": "due_date",
                "kind": "required",
                "type": "string<date-time>",
                "description": "<p>Date and time on which the milestone will expire, in ISO 8601 UTC format</p>",
                "example": "2023-10-07T13:15:30Z",
                "format": "date-time"
              },
              {
                "name": "campaign",
                "kind": "required",
                "type": "object",
                "nullable": true,
                "description": "Campaign associated with the milestone",
                "example": "",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Unique identifier of the campaign",
                    "example": "63f1c2b675be4132854d2742"
                  }
                ]
              },
              {
                "name": "links",
                "kind": "required",
                "type": "object",
                "description": "Meta links",
                "example": "",
                "schema": [
                  {
                    "name": "self",
                    "kind": "required",
                    "type": "string",
                    "description": "URL of the milestone",
                    "example": "https://api.cmp.optimizely.com/v3/milestones/63f1c2b675be4132854d2741"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/MilestoneResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Client error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Unsupported arguments: a,b,c\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "Authorization error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Unauthorized\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "Permission error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"You do not have the permission to perform this operation\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "Not found error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Resource not found\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "Unprocessable entity error",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"message\":\"Resource cannot be processed\"}",
            "description": "Error payload",
            "customType": "Error",
            "schema": [
              {
                "name": "message",
                "kind": "required",
                "type": "string",
                "description": "Message describing the error",
                "example": "Not found"
              },
              {
                "name": "errors",
                "kind": "optional",
                "type": "map",
                "description": "Additional information",
                "example": "",
                "customType": "map<string, string>",
                "schema": []
              }
            ],
            "modelRef": "#/components/schemas/Error",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "NjgFFUXoqb4DCLANWqU9N",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url https://api.cmp.optimizely.com/v3/milestones/{id} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"tasks\": [\n     {\n     \"id\": \"\"\n     }\n     ]\n     }'"
        },
        {
          "id": "Uock4lsfLXZsj6bB19JIX",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"tasks\": [\n      {\n         \"id\": \"\"\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.cmp.optimizely.com/v3/milestones/{id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "JGbP4rgJyXpDtCr11QAtF",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.cmp.optimizely.com/v3/milestones/{id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"tasks\": [\n      {\n         \"id\": \"\"\n      }\n   ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "gzgl8U-UNHxzsgQGIl3uS",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.cmp.optimizely.com/v3/milestones/{id}\"\n\npayload = json.dumps({\n   \"tasks\": [\n      {\n         \"id\": \"\"\n      }\n   ]\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "NjgFFUXoqb4DCLANWqU9N"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Updated milestone\n{\n  \"id\": \"63f1c2b675be4132854d2741\",\n  \"title\": \"Sample Milestone\",\n  \"color\": \"#4ECFD5\",\n  \"description\": \"This is a milestone\",\n  \"due_date\": \"2023-10-07T13:15:30Z\",\n  \"campaign\": {\n    \"id\": \"63f1c2b675be4132854d2742\"\n  },\n  \"links\": {\n    \"self\": \"https://api.cmp.optimizely.com/v3/milestones/63f1c2b675be4132854d2741\"\n  }\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Client error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Authorization error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Permission error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-4-404",
          "language": "404",
          "code": "// Not found error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        },
        {
          "id": "response-5-422",
          "language": "422",
          "code": "// Unprocessable entity error\n{\n  \"message\": \"Not found\",\n  \"errors\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}