---
title: Update Tenant Consent Expiration Toggle
slug: api-documentation/update-tenant-consent-expiration-toggle
docTags: 
createdAt: 2026-08-27T17:02:39.001Z
---

{
  "id": "FUTv9bYCxdPqPp4UHb5S2",
  "type": "api-oas-v2",
  "data": {
    "method": "PUT",
    "url": "https://api.upstartcommerce.com/v1/customer/consent/category-expiration/{categoryId}",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/v1/customer/consent/category-expiration/{categoryId}"
      }
    ],
    "name": "Update Tenant Consent Expiration Toggle",
    "description": "Update the expiration info for the consent category.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "categoryId",
          "type": "string",
          "example": "8ad2f2d1-91fc-40bd-8f94-64c787fa009f",
          "description": "The unique identifier of the Consent Category to be updated."
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "x-upstart-tenant",
          "type": "string",
          "description": "Tenant identifier associated with the site."
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "",
          "customType": "ConsentCategoryExpirationRequest",
          "schema": [
            {
              "name": "expiryEnabled",
              "kind": "required",
              "type": "boolean",
              "description": ""
            },
            {
              "name": "expiryDuration",
              "kind": "required",
              "type": "string",
              "description": "Duration in format like '1 year 2 months 3 days'"
            },
            {
              "name": "updateExistingConsents",
              "kind": "optional",
              "type": "boolean",
              "description": ""
            }
          ],
          "modelRef": "#/components/schemas/ConsentCategoryExpirationRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "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": "Consent Category Expiration Updated Successfully",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ConsentCategoryExpirationResponse",
            "schema": [
              {
                "name": "tenant",
                "kind": "required",
                "type": "string",
                "description": "tenant"
              },
              {
                "name": "categoryId",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "expiryEnabled",
                "kind": "required",
                "type": "boolean",
                "description": "",
                "default": false
              },
              {
                "name": "expiryDuration",
                "kind": "required",
                "type": "string",
                "description": "Duration in format like '1 year 2 months 3 days'"
              },
              {
                "name": "updateExistingConsents",
                "kind": "required",
                "type": "boolean",
                "description": "",
                "default": false
              }
            ],
            "modelRef": "#/components/schemas/ConsentCategoryExpirationResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "The request contained information that the server was unable to process. Appropriate errors are provided in the response body.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "Error response for validation errors",
            "customType": "ValidationErrorResponse[]",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ValidationErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "The provided credentials were not valid for this endpoint.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "UnauthorizedErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/UnauthorizedErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "403",
        "description": "User's roles are insufficient for this endpoint.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "The requested resource was not found in the NoChannel system.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "405",
        "description": "This is to indicate that the server has received a request with an HTTP method that is not supported for the requested resource.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "409",
        "description": "This response indicates that the server cannot process the request due to a conflict with the current state of the resource.  This typically occurs when a request attempts to create or modify a resource that already exists or conflicts with another resource.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ConflictErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              },
              {
                "name": "conflicts",
                "kind": "required",
                "type": "array",
                "description": "List of conflicting data points and their details",
                "modelRef": "#/components/schemas/ConflictDetail",
                "customType": "ConflictDetail[]",
                "schema": [
                  {
                    "name": "index",
                    "kind": "required",
                    "type": "integer",
                    "description": "Index of the conflicting data point in the request array"
                  },
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "ID of the conflicting data point"
                  },
                  {
                    "name": "existingResource",
                    "kind": "required",
                    "type": "string",
                    "description": "Reference to the existing resource that caused the conflict"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/ConflictErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "415",
        "description": "This is to indicate that the server cannot process the request because the media type of the request entity is not supported or not recognized by the server.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "422",
        "description": "<p>This is to indicate that the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "423",
        "description": "<p>Consent Management is disabled or locked for the tenant, so consent operations are not allowed.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "array",
            "description": "Error response for validation errors",
            "customType": "ValidationErrorResponse[]",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ValidationErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "There was an internal server error.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "iL2bgQH-y16f7w4UFwvSj",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PUT \\\n     --url https://api.upstartcommerce.com/v1/customer/consent/category-expiration/{categoryId} \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-upstart-tenant: string' \\\n     --data '{\n     \"expiryEnabled\": \"\",\n     \"expiryDuration\": \"\"\n     }'"
        },
        {
          "id": "Jw4yCA40fwyBB9Pcub8oE",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-upstart-tenant\", \"string\");\n\nvar raw = JSON.stringify({\n   \"expiryEnabled\": \"\",\n   \"expiryDuration\": \"\"\n});\n\nvar requestOptions = {\n   method: 'PUT',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.upstartcommerce.com/v1/customer/consent/category-expiration/{categoryId}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "xxM6rjKrLBGo6hoK9VpRP",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/v1/customer/consent/category-expiration/{categoryId}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Put.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-upstart-tenant\"] = \"string\"\nrequest.body = JSON.dump({\n   \"expiryEnabled\": \"\",\n   \"expiryDuration\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "AKCXO4szHqfVA0tVGySdM",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/v1/customer/consent/category-expiration/{categoryId}\"\n\npayload = json.dumps({\n   \"expiryEnabled\": \"\",\n   \"expiryDuration\": \"\"\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-upstart-tenant': 'string'\n}\n\nresponse = requests.request(\"PUT\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "iL2bgQH-y16f7w4UFwvSj"
    },
    "results": {
      "languages": [
        {
          "id": "IGs3nrngQX9vmbAJS_EmL",
          "language": "200",
          "code": "// Consent Category Expiration Updated Successfully\n{\n  \"tenant\": \"\",\n  \"categoryId\": \"\",\n  \"expiryEnabled\": false,\n  \"expiryDuration\": \"\",\n  \"updateExistingConsents\": false\n}"
        },
        {
          "id": "Q5IKMf6o50ZtMIkMkI3pM",
          "language": "400",
          "code": "// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.\n[\n  {\n    \"name\": \"\",\n    \"code\": \"\",\n    \"detail\": \"\",\n    \"reason\": \"\"\n  }\n]"
        },
        {
          "id": "7TrngasgadToVw4Y0zMnr",
          "language": "401",
          "code": "// The provided credentials were not valid for this endpoint.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "LJMIxOxSb1Y2SnrtF-Ep-",
          "language": "403",
          "code": "// User's roles are insufficient for this endpoint.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "QMfS2PDNmGXiqWNCV_Biq",
          "language": "404",
          "code": "// The requested resource was not found in the NoChannel system.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "ZEN63h8lG_7xJfpoLEoMv",
          "language": "405",
          "code": "// This is to indicate that the server has received a request with an HTTP method that is not supported for the requested resource.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "qMrERy7FYfWOkUcxnb0SE",
          "language": "409",
          "code": "// This response indicates that the server cannot process the request due to a conflict with the current state of the resource.  This typically occurs when a request attempts to create or modify a resource that already exists or conflicts with another resource.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\",\n  \"conflicts\": [\n    {\n      \"index\": 0,\n      \"id\": \"\",\n      \"existingResource\": \"\"\n    }\n  ]\n}"
        },
        {
          "id": "uNd-P35MbjLddpFYgAA-0",
          "language": "415",
          "code": "// This is to indicate that the server cannot process the request because the media type of the request entity is not supported or not recognized by the server.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "rrlJSQ1mvCch3GQKtfqq1",
          "language": "422",
          "code": "// This is to indicate that the server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        },
        {
          "id": "M2TXYy5H6SFNkmxgn79Iq",
          "language": "423",
          "code": "// Consent Management is disabled or locked for the tenant, so consent operations are not allowed.\n[\n  {\n    \"name\": \"\",\n    \"code\": \"\",\n    \"detail\": \"\",\n    \"reason\": \"\"\n  }\n]"
        },
        {
          "id": "RN1l7lIGsapHzbkKwlhNB",
          "language": "500",
          "code": "// There was an internal server error.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "IGs3nrngQX9vmbAJS_EmL"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}