Skip to main content
POST
/
v1
/
accounts
/
cookies
Refresh Cookies
curl --request POST \
  --url https://api.lobstr.io/v1/accounts/cookies \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "account": "<string>",
  "type": "<string>",
  "cookies": {}
}
'
{
  "id": "<string>",
  "object": "<string>",
  "status_code": 123,
  "status_text": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://docs.lobstr.io/llms.txt

Use this file to discover all available pages before exploring further.

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

Authorization
string
required
Your API authentication token. Value: Token YOUR_API_KEY
Content-Type
string
required
Must be application/json. Value: application/json

Request Body

account
string
required
Existing account hash to update. Example: "abfeb440ceccdfab974e8d261836c9d6"
type
string
required
Account type identifier. Example: "twitter-sync"
cookies
object
required
Object containing updated cookie name-value pairs. Example: {"auth_token": "...", "ct0": "..."}

Response Field Explanations

id
string
Synchronization task identifier. Example: "7966b678b6b63ef599deeea99cb2b219"
object
string
Always “synchronize-cookies”. Example: "synchronize-cookies"
status_code
integer
Task status code (100 = created). Example: 100
status_text
string
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."
}