---
title: Delink variants from a product.
slug: api-documentation/delink-variants-from-a-product
docTags: 
createdAt: 2026-08-27T17:00:05.343Z
---

{
  "id": "wV6VTUBh9ejRWPg4LMboV",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.upstartcommerce.com/pim/products/{id}/delink-variants",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/pim/products/{id}/delink-variants"
      }
    ],
    "name": "Delink variants from a product.",
    "description": "<p>This allows admins to delink variants from a product using the productId in the path and the variant ids in the payload. The product is read from draft first (product_item_v2) and, when it is not present there, from the published version (product_item_live_v2). The provided variant ids are removed from the product's existing variants and the standard update-product flow is then triggered. If the product is not available in draft or in live an error is returned.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "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": "",
          "schema": [
            {
              "name": "variantIds",
              "kind": "required",
              "type": "array",
              "description": "<p>List of variant ids to be delinked (removed) from the product identified by the path productId.</p>",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "NoChannelPortalAccess",
          "name": "NoChannelPortalAccess",
          "kind": "optional",
          "type": "http",
          "description": "<p>(DEPRECATED) This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "scheme": "bearer"
        },
        {
          "id": "ApiKeyAccess",
          "name": "X-Upstart-Api-Key",
          "kind": "optional",
          "type": "apiKey",
          "description": "Api key based authorization.",
          "in": "header"
        },
        {
          "id": "SessionIdAccess",
          "name": "X-Upstart-Session-Id",
          "kind": "optional",
          "type": "apiKey",
          "description": "<p>Session based authorization. This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "in": "header"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "All requested variants were successfully delinked from the product.",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "Allow",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Cache-Control",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Content-Type",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "ETag",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Location",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "207",
        "description": "<p>Partial success. Some variants were delinked while others failed (for example a variant that is not associated to the product or not found). The response body reports the per-variant status.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "Allow",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Cache-Control",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "Content-Type",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "ETag",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "R4EzI7JIORIzF9F7mMByC",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.upstartcommerce.com/pim/products/{id}/delink-variants \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"variantIds\": []\n     }'"
        },
        {
          "id": "-NsvrwAfpb3j9bx69Pky9",
          "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   \"variantIds\": []\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.upstartcommerce.com/pim/products/{id}/delink-variants\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "_zI8c-4llr31kGhIwd2LB",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/pim/products/{id}/delink-variants\")\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/json\"\nrequest.body = JSON.dump({\n   \"variantIds\": []\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "_fz_zCXk7MDjYsG1wvJdr",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/pim/products/{id}/delink-variants\"\n\npayload = json.dumps({\n   \"variantIds\": []\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "R4EzI7JIORIzF9F7mMByC"
    },
    "results": {
      "languages": [
        {
          "id": "-QkkadeSSXtYil1ZfIFAm",
          "language": "200",
          "code": "// All requested variants were successfully delinked from the product.\n{}"
        },
        {
          "id": "M8CIy4kL0-AnKMTNCowht",
          "language": "207",
          "code": "// Partial success. Some variants were delinked while others failed (for example a variant that is not associated to the product or not found). The response body reports the per-variant status.\n{}"
        }
      ],
      "selectedLanguageId": "-QkkadeSSXtYil1ZfIFAm"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}