Update cookie config API in Website Scanner
Use this API to update an existing cookie configuration. The API changes only the fields you send. To rotate cookies, send only the cookies field.
update cookie config
If Geo Region Restriction (GRR) is enabled for your account, add your region code to the host name:
api-accessibility-<region>.browserstack.com. See Geo Region Restriction endpoints for the region codes and examples.
Request parameters
Request
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X PUT "https://api-accessibility.browserstack.com/api/website-scanner/v1/cookie_configs/24" \
-H "Content-Type: application/json" \
-d '{ "cookies": "consent=accepted-v2; region=uk" }'
-
id* Integer
The unique ID of the cookie configuration to update.
-
name String
A unique name for the cookie configuration. Maximum 255 characters.
-
domain String
The domain the cookies apply to, without a scheme or path (for example,
example.com). The apex domain covers all subdomains, includingwww. -
cookies String
Semicolon-separated
name=valuepairs (for example,consent=accepted; region=uk). Maximum 50 cookies per configuration, cookie name up to 255 characters, cookie value up to 4096 characters.
Response attributes 200 OK JSON
Response
{
"success": true,
"data": {
"id": 24,
"name": "consent_config_1",
"domain": "example.com",
"cookies": "consent=accepted-v2; region=uk",
"createdAt": "2026-10-09T10:00:00Z"
},
"error": null
}
-
success Boolean
Indicates whether the request was successful.
-
data Object
â–¶ SHOW VALUESThe updated cookie configuration object.
-
id Integer
The unique ID of the cookie configuration.
-
name String
The name of the cookie configuration.
-
domain String
The domain the cookies apply to.
-
cookies String
Semicolon-separated
name=valuepairs representing the cookies. -
createdAt String
The ISO 8601 timestamp when the cookie configuration was created.
-
Error responses 404 Not Found
The API returns a 404 status code if the cookie configuration ID doesn’t exist or belongs to another account.
Error responses 422 Unprocessable Entity
The API returns a 422 status code when validation fails. The following validation errors can occur:
A cookie configuration named '<name>' already exists'<domain>' is not a valid domain. Send the domain only, without https:// or a pathCookie '<entry>' must be in name=value formatDuplicate cookie name '<name>'Cookie name '<name>' is longer than 255 charactersCookie '<name>' has a value longer than 4096 charactersA configuration can hold at most 50 cookies
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.