Cookies
PUT
Updates cookies. The request body has the following shape:
{ "account_id": "<string>", "category": "<enum{'unclassified', 'essential', 'performance', 'analytics;', 'advertising', 'social_networking'}>", "country": "<string>", "domain": "<string>", "de": "<string>", "en_uk": "<string>", "en_us": "<string>", "fr": "<string>", "id": "<string>", "initiator": "<string>", "name": "<string>", "service": "<string>", "service_policy_link": "<string>", "source": "<string>", "tracker_type": "<enum{'http_cookie', 'html_local_storage', 'html_session_storage', 'server_cookie', 'pixel_tracker', 'indexed_db'}>", "url": "<string>", "value": "<string>", "website_id": "<string>"}
account_id
is the unique identifier of the accountcategory
is the cookie categorycountry
is the country that sourced the cookie, based on a geoip lookupdomain
is the domain of the cookiede
is the description in Germanen_uk
is the description in UK Englishen_us
is the description in US Englishfr
is the description in Frenchid
is the unique identifier of the cookieinitiator
is the url that sourced the cookiename
is the name of the cookieservice
is a value indicating the service that soured the cookieservice_policy_link
is a link to the servie policy of the websitesource
is the source of the cookietracker_type
is one ofhttp_cookie
,html_local_storage
,html_session_storage
,server_cookie
,pixel_tracker
,indexed_db
url
is the url of the cookievalue
is the cookie valuewebsite_id
is the unique identifier of the website
At least 1 object with the field account_id and website_id is required.
The results will contain zero or more of the following objects:
{ "account_id": "<string>", "category": "<enum{'unclassified', 'essential', 'performance', 'analytics;', 'advertising', 'social_networking'}>", "country": "<string>", "domain": "<string>", "de": "<string>", "en_uk": "<string>", "en_us": "<string>", "fr": "<string>", "party_provider_type": "<string>", "initiator": "<string>", "name": "<string>", "service": "<string>", "service_policy_link": "<string>", "source": "<string>", "tracker_type": "<enum{'http_cookie', 'html_local_storage', 'html_session_storage', 'server_cookie', 'pixel_tracker', 'indexed_db'}>", "url": "<string>", "value": "<string>", "website_id": "<string>" "_idx": <integer>}
If one of the collaborators cannot be updated, the object will be an error object. If the error is a validation error, there will be a field called validation errors
Example 1
Updates a single cookie for a single website.
Request
PUT https://api.termly.io/v1/websites/cookies
Request Body
[ { "account_id": "acct_1234", "category": null, "country": "United States", "domain": "https://example.com", "de": null, "en_uk": null, "en_us": "Tracks the widget", "fr": null, "id": "ck_1234", "initiator": null, "name": "ACME Tracker", "service": null, "service_policy_link": null, "source": null, "tracker_type": "http_cookie", "url": "https://example.com/cisforcookie", "value": "that's good enough for me", "website_id": "web_1234" }]
Response
[ { "account_id": "acct_1234", "id": "ck_1234", "website_id": "web_1234", "_idx": 0 }]
Example 2
Update multiple cookies for multiple websites.
Request
PUT https://api.termly.io/v1/websites/cookies
Request Body
[ { "account_id": "acct_1234", "category": null, "country": "United States", "domain": "https://example.com", "de": null, "en_uk": null, "en_us": "Tracks the widget", "fr": null, "id": "ck_1234", "initiator": null, "name": "ACME Tracker", "service": null, "service_policy_link": null, "source": null, "tracker_type": "http_cookie", "url": "https://example.com/cisforcookie", "value": "that's good enough for me", "website_id": "web_1234" }, { "account_id": "acct_1234", "category": null, "country": "United States", "domain": "https://example.com", "de": null, "en_uk": null, "en_us": "Tracks the widget", "fr": null, "id": "ck_5678", "initiator": null, "name": "ACME Tracker", "service": null, "service_policy_link": null, "source": null, "tracker_type": "http_cookie", "url": "https://example.com/cisforcookie", "value": "that's good enough for me", "website_id": "web_0987" }, { "account_id": "acct_4567", "category": null, "country": "United States", "domain": "https://example.com", "de": null, "en_uk": null, "en_us": "Tracks the widget", "fr": null, "id": "ck_2112", "initiator": null, "name": "ACME Tracker", "service": null, "service_policy_link": null, "source": null, "tracker_type": "http_cookie", "url": "https://example.com/cisforcookie", "value": "that's good enough for me", "website_id": "web_4567" }]
Response
[ { "account_id": "acct_1234", "id": "ck_1234", "website_id": "web_1234", "_idx": 0 }, { "account_id": "acct_1234", "id": "ck_5678", "website_id": "web_0987", "_idx": 1 }, { "account_id": "acct_4567", "id": "ck_2112", "website_id": "web_4567", "_idx": 2 }]
Example 3
Updates single cookie with multiple requests due to website not found.
Request
PUT https://api.termly.io/v1/websites/cookies
Request Body
[ { "account_id": "acct_1234", "category": null, "country": "United States", "domain": "https://example.com", "de": null, "en_uk": null, "en_us": "Tracks the widget", "fr": null, "id": "ck_1234", "initiator": null, "name": "ACME Tracker", "service": null, "service_policy_link": null, "source": null, "tracker_type": "http_cookie", "url": "https://example.com/cisforcookie", "value": "that's good enough for me", "website_id": "web_1234" }, { "account_id": "acct_1234", "category": null, "country": "United States", "domain": "https://example.com", "de": null, "en_uk": null, "en_us": "Tracks the widget", "fr": null, "id": "ck_0000", "initiator": null, "name": "ACME Tracker", "service": null, "service_policy_link": null, "source": null, "tracker_type": "http_cookie", "url": "https://example.com/cisforcookie", "value": "that's good enough for me", "website_id": "web_0987" }]
Response
[ { "account_id": "acct_1234", "id": "ck_1234", "website_id": "web_1234", "_idx": 0 }, { "account_id": "acct_1234", "error": "object_not_found", "id": "web_0987", "_idx": 1 }]