Update profile cookies
Write an array of cookie objects to a profile.
Definition: POST · Checked on 2026-10-21.
Request
POST /api/updateCookieUse the base URL and api-key shown on the client API screen. All examples use 9000 only as a placeholder port; see Overview for authentication.
JSON body
| Field | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Profile ID |
cookies | object[] | Yes | Cookie object array replaces all cookies; [] clears them, do not send a JSON string; close and back up first |
cURL example
curl --request POST 'http://127.0.0.1:9000/api/updateCookie' \
--header 'api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"id": 1,
"cookies": [
{
"domain": ".example.com",
"expirationDate": 4102444800,
"hostOnly": false,
"httpOnly": true,
"name": "SNID",
"path": "/XXXX",
"sameSite": "lax",
"secure": true,
"session": false,
"storeId": null,
"value": "EXAMPLE_COOKIE_VALUE"
}
]
}'Response example
{
"success": true
}Current client response fields
| Field | Type | Usage |
|---|---|---|
success | boolean | Request processing succeeded; not a guarantee that every item was written |
Field reference
| Field | Type | Description |
|---|---|---|
cookies[].domain | string | Nonempty domain, e.g. .example.com; missing values skip the item |
cookies[].name | string | Nonempty string; missing values skip the item |
cookies[].value | string | Nonempty string; missing or empty values skip the item; never publish real cookies |
cookies[].path | string | Path string; defaults to / |
cookies[].expirationDate | number | Positive Unix timestamp in seconds; invalid or omitted non-session values default to about one year |
cookies[].hostOnly / httpOnly / secure / session | boolean | Cookie attributes |
cookies[].sameSite | string | String lax, strict, none or no_restriction; none and no_restriction map to 0 |
cookies[].storeId | null | null in the online reference example |
Usage notes
- Close the profile first. Pass cookies as an array of objects, not as a cookie.jsonStr string.
- See the import and replacement rules below; do not assume a lossless round trip.
For failed requests, check both HTTP status and the error body. See Errors & troubleshooting.
Full replacement: back up first
The current client clears the browser Cookie table before inserting valid items from cookies; this is not an incremental update. A non-array is normalized to an empty array and can clear existing cookies; [] also clears them. Close the profile and back it up first to avoid losing sessions.
Current import rules:
- Each entry needs nonempty
domain,name, andvalue, otherwise it is skipped;pathdefaults to/. Entries withsession: trueare not written. expirationDateis Unix seconds. An absent or invalid positive value defaults to about one year for non-session entries. The example is illustrative.- Use string
sameSite:lax,strict,none, orno_restriction. Inputnoneandno_restrictionboth map to 0; unknown values and numbers are not preserved as-is. Export reports 0 asunspecified, so a lossless round trip is not guaranteed. - Invalid entries may be skipped; an individual insertion error may be logged while the API still reports success. Re-read and verify after writing rather than relying only on
success.
Cookie values are often login credentials; never publish request bodies, exports or backups.
For a profile with cloud sync enabled, updating cookies may schedule a delayed background upload; success does not mean the upload has completed.



