Skip to content
Home » Local API V2 – Cookie Interface

Local API V2 – Cookie Interface

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 value field. When importing Cookies, provide the value field as well.

List Profile Cookies

Endpoint

GET /openapi/v2/profiles/{profileId}/cookies

Returns the Cookies for a Profile.

Path Parameters

NameTypeRequiredDescription
profileIdstringYesProfile ID.

Query Parameters

NameTypeRequiredDescription
domainstringNoFilters by Cookie domain. Omit this parameter to return all domains.

Response Parameters

data contains the Cookie query result:

NameTypeDescription
profile_idstringProfile ID.
cookiesobject[]Cookie list. See Cookie Parameters for field details.
cookie_convert_statebooleanWhether the Cookie conversion succeeded.
cookie_encrypt_statusstringCookie encryption status: OLD_ENCRYPTNEW_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

NameTypeRequiredDescription
profileIdstringYesProfile 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

NameTypeRequiredDescription
profileIdstringYesProfile 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

NameTypeRequiredDescription
profileIdstringYesProfile ID.

Parameter Reference

CookieImportRequest:

NameTypeRequiredDescription
modestringNoImport mode. Allowed values: replacemerge.
cookiesobject[]NoCookie list. A single request may contain up to 5000 items. When importing, domainname, and value are required for each item.

CookieItem:

NameTypeRequiredDescription
domainstringYes when importingDomain.
pathstringNoPath.
namestringYes when importingCookie name.
valuestringYes when importingCookie value. It may be an empty string, but it cannot be null.
encrypted_valuestringNoEncrypted Cookie value, returned only in read responses. Use value when importing.
expiration_dateintegerNoExpiration time as a Unix timestamp in seconds.
http_onlybooleanNoWhether the Cookie is HttpOnly.
securebooleanNoWhether the Cookie is Secure.
same_sitestringNoSameSite policy. Allowed values: unspecifiedno_restrictionstrictlax.
host_onlybooleanNoWhether the Cookie is HostOnly. Provided for compatibility with extended Cookie formats.
sessionbooleanNoWhether this is a session Cookie. Provided for compatibility with extended Cookie formats.
store_idstringNoCookie Store ID. Provided for compatibility with extended Cookie formats.
has_expiresbooleanNoWhether an expiration time is explicitly set. Provided for compatibility with extended Cookie formats.
prioritystringNoPriority. Provided for compatibility with extended Cookie formats.
is_same_partybooleanNoWhether the Cookie is SameParty.