Refresh Cookies
Update and re-synchronize cookies for an existing account
https://api.lobstr.io/v1/accounts/cookiesThis endpoint updates and synchronizes cookies for an existing account using its account hash. Use this when your account cookies have expired or need to be refreshed.
Headers
AuthorizationstringheaderrequiredYour API authentication token. Value: Token YOUR_API_KEY
Content-TypestringheaderrequiredMust be application/json. Value: application/json
Request Body
accountstringrequiredExisting account hash to update. Example: "abfeb440ceccdfab974e8d261836c9d6"
typestringrequiredAccount type identifier. Example: "twitter-sync"
cookiesobjectrequiredObject containing updated cookie name-value pairs. Example: {"auth_token": "...", "ct0": "..."}
Response Field Explanations
idstringSynchronization task identifier. Example: "7966b678b6b63ef599deeea99cb2b219"
objectstringAlways "synchronize-cookies". Example: "synchronize-cookies"
status_codeintegerTask status code (100 = created). Example: 100
status_textstringHuman-readable status. Example: "created"
Refresh cookies immediately when you notice status_code_info showing 'cookies_expired' in List Accounts or Get Account Details.
Use the returned task ID with Check Sync Status to monitor the refresh process.
Refreshing cookies preserves all account settings and limits. You don't need to reconfigure the account after refresh.
Set up monitoring to check account status regularly and automate cookie refresh when needed.
Code Examples
curl -X POST "https://api.lobstr.io/v1/accounts/cookies" \ -H "Authorization: Token YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "account": "abfeb440ceccdfab974e8d261836c9d6", "type": "twitter-sync", "cookies": { "auth_token": "<cookie.auth_token>", "ct0": "<cookie.ct0>" } }'
Response
{ "id": "7966b678b6b63ef599deeea99cb2b219", "object": "synchronize-cookies", "status_code": 100, "status_text": "created" }
{ "detail": "Invalid cookies or account type mismatch." }
{ "detail": "Account not found." }