---
title: "Add Cookies"
method: POST
path: "/api/cmp/v1/webscans/cookies"
tags: ["Cookies"]
---

# Add Cookies

`POST /api/cmp/v1/webscans/cookies`

## Request

- Base URL: `https://hostname`
- URL: `https://hostname/api/cmp/v1/webscans/cookies`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://{hostname}/api/access/v1/oauth/token` scopes: `COOKIE`

Use this API to add cookies.

## Request body

- CookieCreationRequestDto[]
  - `cookieName` string: The name of the cookie.
  - `lifespan` 'SESSION' | 'PERSISTENT', required: The duration for which the cookie remains active before expiring.
  - `host` string: The domain or website that created the cookie.
  - `description` string: The description of the cookie and its intended purpose.
  - `thirdPartyDescription` string: The description of third-party cookies and their usage.
  - `length` integer: Length of the Cookie lifespan, enter a number greater than 0 if this is a PERSISTENT cookie, otherwise leave as 0
  - `durationType` integer, required: The type of duration indicating whether the cookie is session-based or persistent.
  - `cookieId` string, uuid: The unique identifier of the cookie.
  - `customCategoryName` string, required: The custom name assigned to the cookie category.
  - `domainCookieCategoryList` DomainCookieCategoryRequestDto[]: The list of categories assigned to cookies for the specific domain.
    - `domainId` string, uuid: The unique identifier of the domain.
    - `customCategoryName` string: The custom name assigned to the cookie category.
    - `thirdParty` boolean: This flag indicates whether the cookie originates from a third-party source.
    - `description` string: The description of the cookie and its intended purpose.

## Response `201`

Created

- EntityActionResponseDtoCookieEntityDto[]
  - `entityId` string, uuid: The unique identifier of the entity.
  - `entityType` 'SCAN' | 'DOMAIN' | 'COOKIE': The type of entity such as cookie, tag, page, form, service, or storage.
  - `action` 'ARCHIVE' | 'SCHEDULE' | 'SCHEDULE_CANCEL' | 'EDIT' | 'CREATE' | 'DELETE': The action that was performed or is to be performed.
  - `message` string: The message or notification text.
  - `content` CookieEntityDto
    - `id` string, uuid: The unique identifier of the item.
    - `name` string: The name or title of the item.
    - `description` string: The description of the cookie and its intended purpose.
    - `thirdPartyDescription` string: The description of third-party cookies and their usage.
    - `host` string: The domain or website that created the cookie.
    - `path` string: The URL path where the cookie is active.
    - `source` 'SCAN' | 'MANUAL' | 'EXTERNALSCANNER' | 'MANUALBULK' | 'TELEMETRYSCANNER': The source from which the data or cookie originated.
    - `cookieLifeSpan` 'SESSION' | 'PERSISTENT': The duration for which the cookie remains valid.
    - `httpOnly` boolean: This flag indicates whether the cookie can only be accessed via HTTP requests.
    - `secure` boolean: This flag indicates whether the cookie requires a secure HTTPS connection.
    - `length` integer: Length of the Cookie lifespan. This is used in combination with 'durationType'. If 'length' = 5 and 'durationType' = 7, that means 5 weeks.
    - `durationType` integer: The type of duration indicating whether the cookie is session-based or persistent.
  - `success` boolean: This flag indicates whether the operation completed successfully.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests. For more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500`: Internal Server Error

---

[API](https://skmtc.dev/onetrust/apis/consent-preferences-cookie-consent.md) - [All operations](https://skmtc.dev/onetrust/apis/consent-preferences-cookie-consent/llms.txt) - [OpenAPI document](https://skmtc.dev/onetrust/apis/consent-preferences-cookie-consent/revisions/b4fb4606f973?raw)
