> ## Documentation Index
> Fetch the complete documentation index at: https://developer.onetrust.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Cookies

Use this API to edit existing cookies.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Consent & Preferences - Cookie Consent",
    "version": "1.0",
    "contact": {
      "name": "OneTrust Support",
      "url": "https://my.onetrust.com/s/contactsupport"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "description": "The Cookie Consent APIs are used to integrate external systems and streamline the flow of data with Cookie Consent in the OneTrust Platform."
  },
  "servers": [
    {
      "url": "https://{hostname}",
      "variables": {
        "hostname": {
          "default": "hostname",
          "description": "The OneTrust hostname such as app.onetrust.com, app-eu.onetrust.com, app-de.onetrust.com, app-uk.onetrust.com, app-apac.onetrust.com, trial.onetrust.com, or uat.onetrust.com."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Cookies",
      "description": "The Cookies APIs are used to manage cookie definitions, categories, and their properties.",
      "externalDocs": {
        "description": "OpenAPI 3.1.0 - Download Definition",
        "url": "https://developer.onetrust.com/onetrust/openapi/consent-preferences-cookie-consent.json"
      }
    }
  ],
  "x-onetrust": {
    "spec-label": "OpenAPI 3.1.0"
  },
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false,
    "metrics-enabled": false
  },
  "paths": {
    "/api/cmp/v1/webscans/cookies": {
      "put": {
        "operationId": "bulkEditCookies",
        "summary": "Edit Cookies",
        "description": "Use this API to edit existing cookies.",
        "tags": [
          "Cookies"
        ],
        "x-onetrust": {
          "spec-label": "https://developer.onetrust.com/onetrust/openapi/consent-preferences-cookie-consent.json"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CookieUpdateRequestDto"
                },
                "uniqueItems": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EntityActionResponseDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "429": {
            "description": "Too Many Requests. \nFor more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "description": "The number of seconds after which requests will be allowed again.",
                  "format": "int32"
                }
              },
              "ot-period": {
                "schema": {
                  "description": "The unit of time for which the rate limit applies",
                  "enum": [
                    "HOUR",
                    "MINUTE"
                  ]
                }
              },
              "ot-ratelimit-event-id": {
                "schema": {
                  "description": "The unique identifier for the rate-limiting event.",
                  "format": "uuid"
                }
              },
              "ot-request-made": {
                "schema": {
                  "description": "The number of requests made within the specified period.",
                  "format": "int32"
                }
              },
              "ot-requests-allowed": {
                "schema": {
                  "description": "The number of requests allowed within the specified period.",
                  "format": "int32"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "OAUTH2": [
              "COOKIE"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "CookieSourceRequestDto": {
        "type": "object",
        "properties": {
          "domainId": {
            "description": "The unique identifier of the domain.",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "domainCookieSourceRequestDtoList": {
            "description": "The list of cookie source configuration requests for the domain.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainCookieSourceRequestDto"
            },
            "example": [
              {
                "Id": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
                "ResourceUrl": "amazon.com",
                "resourceType": "MANUAL",
                "resourceOrigin": "MANUAL",
                "resourceMatchType": "URL",
                "trackerType": "cookie"
              }
            ],
            "maxItems": 1000,
            "minItems": 0
          }
        }
      },
      "CookieUpdateRequestDto": {
        "type": "object",
        "properties": {
          "cookieId": {
            "description": "The unique identifier of the cookie.",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "cookieName": {
            "description": "The name of the cookie.",
            "type": "string",
            "example": "newCookieName123",
            "maxLength": 512,
            "minLength": 0
          },
          "lifespan": {
            "description": "The duration for which the cookie remains active before expiring.",
            "type": "string",
            "example": "SESSION",
            "enum": [
              "SESSION",
              "PERSISTENT"
            ]
          },
          "host": {
            "description": "The domain or website that created the cookie.",
            "type": "string",
            "example": "host.com",
            "maxLength": 512,
            "minLength": 0
          },
          "description": {
            "description": "The description of the cookie and its intended purpose.",
            "type": "string",
            "example": "this cookies is used for functional purposes only",
            "maxLength": 1000,
            "minLength": 1
          },
          "thirdPartyDescription": {
            "description": "The description of third-party cookies and their usage.",
            "type": "string",
            "example": "this cookies is used for targeting purposes only",
            "maxLength": 1000,
            "minLength": 1
          },
          "length": {
            "description": "Length of the Cookie lifespan, enter a number greater than 0 if this is a Persistent cookie, otherwise leave as 0",
            "type": "integer",
            "format": "int32",
            "example": 5,
            "minimum": 0
          },
          "durationType": {
            "description": "The type of duration indicating whether the cookie is session-based or persistent.",
            "type": "integer",
            "format": "int32",
            "example": 7,
            "enum": [
              "1",
              "7",
              "30",
              "365"
            ]
          },
          "customCategoryName": {
            "description": "The custom name assigned to the cookie category.",
            "type": "string",
            "example": "C0001",
            "maxLength": 100,
            "minLength": 1
          },
          "domainToDeleteIds": {
            "description": "The list of domain identifiers to be removed from the system.",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "example": [
              "f2229953-b4b5-4042-8cb9-b78038cc4c46",
              "a1234567-b4b5-4042-8cb9-b78038cc4c47"
            ],
            "maxItems": 1000,
            "minItems": 0
          },
          "domainCookieCategoryList": {
            "description": "The list of categories assigned to cookies for the specific domain.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainCookieCategoryRequestDto"
            },
            "example": [
              {
                "domainId": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
                "customCategoryName": "C0001"
              }
            ],
            "maxItems": 1000,
            "minItems": 0
          },
          "domainCookieSource": {
            "description": "The source from which domain cookies originate.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CookieSourceRequestDto"
            },
            "example": [
              {
                "domainId": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
                "domainCookieSourceRequestDtoList": []
              }
            ],
            "maxItems": 1000,
            "minItems": 0
          },
          "domainCookieSourceToDelete": {
            "description": "The cookie sources that are marked for deletion.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainCookieSourceRequestDto"
            },
            "example": [
              {
                "domainId": "f2229953-b4b5-4042-8cb9-b78038cc4c46",
                "sourceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
              }
            ],
            "maxItems": 1000,
            "minItems": 0
          },
          "descriptionTranslations": {
            "description": "The translations of descriptions provided in different languages.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DescriptionTranslationDto"
            },
            "example": [
              {
                "language": "fr",
                "description": "Ce cookie est utilisé à des fins fonctionnelles uniquement"
              }
            ],
            "maxItems": 1000,
            "minItems": 0
          }
        },
        "required": [
          "cookieId"
        ]
      },
      "DescriptionTranslationDto": {
        "type": "object",
        "properties": {
          "langCode": {
            "description": "The language code used for localization purposes.",
            "type": "string",
            "example": "EN",
            "maxLength": 10,
            "minLength": 2
          },
          "defaultDescription": {
            "description": "The standard description that is used when no translation is provided for a specific language.",
            "type": "string",
            "example": "This is an example",
            "maxLength": 1000,
            "minLength": 1
          },
          "thirdPartyDescription": {
            "description": "The description of third-party cookies and their usage.",
            "type": "string",
            "example": "This is an example",
            "maxLength": 1000,
            "minLength": 1
          }
        }
      },
      "DomainCookieCategoryRequestDto": {
        "type": "object",
        "properties": {
          "domainId": {
            "description": "The unique identifier of the domain.",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "customCategoryName": {
            "description": "The custom name assigned to the cookie category.",
            "type": "string",
            "example": "C0000",
            "maxLength": 100,
            "minLength": 1
          },
          "thirdParty": {
            "description": "This flag indicates whether the cookie originates from a third-party source.",
            "type": "boolean",
            "example": true
          },
          "description": {
            "description": "The description of the cookie and its intended purpose.",
            "type": "string",
            "example": "this cookies is used for targeting purposes only",
            "maxLength": 1000,
            "minLength": 1
          }
        }
      },
      "DomainCookieSourceRequestDto": {
        "type": "object",
        "properties": {
          "resourceType": {
            "description": "The type of web resource such as script, image, or stylesheet.",
            "type": "string",
            "example": "MANUAL",
            "enum": [
              "MANUAL",
              "PATTERN",
              "SCRIPT",
              "MAIN_FRAME"
            ],
            "maxLength": 255,
            "minLength": 1
          },
          "resourceOrigin": {
            "description": "resource origin type",
            "type": "string",
            "example": "MANUAL",
            "enum": [
              "SCANNER",
              "MANUAL"
            ]
          },
          "resourceMatchType": {
            "description": "resource match type",
            "type": "string",
            "example": "URL",
            "enum": [
              "URL",
              "SYSTEM_PATTERN",
              "CUSTOM_PATTERN"
            ]
          },
          "trackerType": {
            "description": "The category of tracking technology being used.",
            "type": "string",
            "example": "cookie",
            "maxLength": 100,
            "minLength": 1
          },
          "id": {
            "description": "The unique identifier of the item.",
            "type": "string",
            "format": "uuid"
          },
          "ResourceUrl": {
            "description": "The web address where the resource is located.",
            "type": "string",
            "example": "amazon.com",
            "maxLength": 255,
            "minLength": 1
          }
        }
      },
      "EntityActionResponseDto": {
        "type": "object",
        "properties": {
          "entityId": {
            "description": "The unique identifier of the entity.",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "entityType": {
            "description": "The type of entity such as cookie, tag, page, form, service, or storage.",
            "type": "string",
            "example": "SCAN",
            "enum": [
              "SCAN",
              "DOMAIN",
              "COOKIE"
            ]
          },
          "action": {
            "description": "The action that was performed or is to be performed.",
            "type": "string",
            "example": "ARCHIVE",
            "enum": [
              "ARCHIVE",
              "SCHEDULE",
              "SCHEDULE_CANCEL",
              "EDIT",
              "CREATE",
              "DELETE"
            ]
          },
          "message": {
            "description": "The message or notification text.",
            "type": "string",
            "example": "Scan queued for archival",
            "maxLength": 500,
            "minLength": 1
          },
          "content": {
            "description": "The main content or data payload of the response.",
            "type": "object"
          },
          "success": {
            "description": "This flag indicates whether the operation completed successfully.",
            "type": "boolean"
          }
        }
      }
    },
    "securitySchemes": {
      "OAUTH2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://{hostname}/api/access/v1/oauth/token",
            "scopes": {
              "COOKIE": "Cookie Scope gives the user access to read/write operations inside the Cookie Consent module.",
              "COOKIE_READ": "Cookie Read Scope gives the user read-only access to the Cookie Consent module."
            }
          }
        }
      }
    }
  }
}
```