Skip to content
Account

Refresh Cookies

Update and re-synchronize cookies for an existing account

The v1 API, for batchesSquids, tasks and runs: many calls on a schedule, delivered where you work. For one call that answers in seconds, use the API v2.
POSThttps://api.lobstr.io/v1/accounts/cookies

This 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

Authorizationstringheaderrequired

Your API authentication token. Value: Token YOUR_API_KEY

Content-Typestringheaderrequired

Must be application/json. Value: application/json

Request Body

accountstringrequired

Existing account hash to update. Example: "abfeb440ceccdfab974e8d261836c9d6"

typestringrequired

Account type identifier. Example: "twitter-sync"

cookiesobjectrequired

Object containing updated cookie name-value pairs. Example: {"auth_token": "...", "ct0": "..."}

Response Field Explanations

idstring

Synchronization task identifier. Example: "7966b678b6b63ef599deeea99cb2b219"

objectstring

Always "synchronize-cookies". Example: "synchronize-cookies"

status_codeinteger

Task status code (100 = created). Example: 100

status_textstring

Human-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

200
{
  "id": "7966b678b6b63ef599deeea99cb2b219",
  "object": "synchronize-cookies",
  "status_code": 100,
  "status_text": "created"
}
400
{
  "detail": "Invalid cookies or account type mismatch."
}
404
{
  "detail": "Account not found."
}