Notes:
- The Cookie endpoints support standard Cookie read and write operations. Profiles with protected Cookie encryption enabled do not support querying, importing, or clearing Cookies through the Local API.
- Cookies returned by queries use the standard
valuefield. When importing Cookies, provide thevaluefield as well.
List Profile Cookies
Endpoint
GET /openapi/v2/profiles/{profileId}/cookies
Returns the Cookies for a Profile.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | Yes | Profile ID. |
Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | No | Filters by Cookie domain. Omit this parameter to return all domains. |
Response Parameters
data contains the Cookie query result:
| Name | Type | Description |
|---|---|---|
profile_id | string | Profile ID. |
cookies | object[] | Cookie list. See Cookie Parameters for field details. |
cookie_convert_state | boolean | Whether the Cookie conversion succeeded. |
cookie_encrypt_status | string | Cookie encryption status: OLD_ENCRYPT, NEW_ENCRYPT. |
Replace Profile Cookies
Endpoint
PUT /openapi/v2/profiles/{profileId}/cookies
Imports Cookies in replace mode, replacing the Profile’s current Cookies with the request body contents.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | Yes | Profile ID. |
Request Parameters
The request body uses the Cookie import parameters described in Cookie Parameters.
Merge Profile Cookies
Endpoint
POST /openapi/v2/profiles/{profileId}/cookies
Imports Cookies in merge mode, merging the request body contents into the Profile’s current Cookies.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | Yes | Profile ID. |
Request Parameters
The request body uses the Cookie import parameters described in Cookie Parameters.
Request Example
{
"mode": "merge",
"cookies": [
{
"domain": ".example.com",
"path": "/",
"name": "session",
"value": "cookie-value",
"expiration_date": 1893456000,
"http_only": true,
"secure": true,
"same_site": "lax"
}
]
}
Clear Profile Cookies
Endpoint
DELETE /openapi/v2/profiles/{profileId}/cookies
Clears all Cookies from a Profile.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
profileId | string | Yes | Profile ID. |
Parameter Reference
Cookie Parameters
CookieImportRequest:
| Name | Type | Required | Description |
|---|---|---|---|
mode | string | No | Import mode. Allowed values: replace, merge. |
cookies | object[] | No | Cookie list. A single request may contain up to 5000 items. When importing, domain, name, and value are required for each item. |
CookieItem:
| Name | Type | Required | Description |
|---|---|---|---|
domain | string | Yes when importing | Domain. |
path | string | No | Path. |
name | string | Yes when importing | Cookie name. |
value | string | Yes when importing | Cookie value. It may be an empty string, but it cannot be null. |
encrypted_value | string | No | Encrypted Cookie value, returned only in read responses. Use value when importing. |
expiration_date | integer | No | Expiration time as a Unix timestamp in seconds. |
http_only | boolean | No | Whether the Cookie is HttpOnly. |
secure | boolean | No | Whether the Cookie is Secure. |
same_site | string | No | SameSite policy. Allowed values: unspecified, no_restriction, strict, lax. |
host_only | boolean | No | Whether the Cookie is HostOnly. Provided for compatibility with extended Cookie formats. |
session | boolean | No | Whether this is a session Cookie. Provided for compatibility with extended Cookie formats. |
store_id | string | No | Cookie Store ID. Provided for compatibility with extended Cookie formats. |
has_expires | boolean | No | Whether an expiration time is explicitly set. Provided for compatibility with extended Cookie formats. |
priority | string | No | Priority. Provided for compatibility with extended Cookie formats. |
is_same_party | boolean | No | Whether the Cookie is SameParty. |