Follow an account, or unfollow it
Early access. Tell us what you're building and we'll set you up. Contact us
api.lempile.com/users/followFollows one X account. An account already followed (or asked to follow) stays as it is (already: true). With undo: true, unfollows it instead: the profile's own Following button, then X's Unfollow, answered once the profile shows its Follow button again (UserUnfollowed; an account it doesn't follow answers already: true with nothing pressed). An unfollow's receipt fingerprint differs from the follow's, so one key never covers both. Not paced.
Scope: accounts.write.
Authentication
X-API-KEY header·A Lempile API key, made in the dashboard under Access tokens.Headers
Idempotency-KeystringOptional. With a key, the write gets a receipt (
GET /writes/{key}) and a repeat replays the first answer.≤ 200 chars
Request body
account_idstringrequiredidentifierstringrequiredThe X handle to follow (or, with
undo, to unfollow), with or without@.Pattern^@?[A-Za-z0-9_]{1,15}$undobooleantrueunfollows the account.trueorfalseonly: any other value answers400. X only (a LinkedIn account answers501).Defaultfalse
Responses
200Followed, or (with undo) unfollowed.
›
undo) unfollowed.application/json
UserFollowedUserFollowed›Show fieldsHide fields
objectanyAlwaysUserFollowedprovideranyAlwaysXidentifierstringalreadyboolean
UserUnfollowedUserUnfollowed›Show fieldsHide fields
objectanyAlwaysUserUnfollowedprovideranyAlwaysXidentifierstringalreadybooleantrue: the account didn't follow it; nothing was pressed.
400errors/invalid_parameters (no X handle, or undo that isn't true or false), errors/cannot_follow_self or errors/cannot_unfollow_self.
›
errors/invalid_parameters (no X handle, or undo that isn't true or false), errors/cannot_follow_self or errors/cannot_unfollow_self.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
401Missing or invalid API key ({error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.
›
{error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
402subscription_required: the workspace has no active trial or subscription.
›
subscription_required: the workspace has no active trial or subscription.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
404errors/user_not_found.
›
errors/user_not_found.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
422errors/profile_not_loaded, errors/follow_unavailable or errors/follow_not_kept; with undo, errors/unfollow_unavailable (X showed no Following button) or errors/unfollow_unconfirmed (X didn't ask to confirm). Nothing changed.
›
errors/profile_not_loaded, errors/follow_unavailable or errors/follow_not_kept; with undo, errors/unfollow_unavailable (X showed no Following button) or errors/unfollow_unconfirmed (X didn't ask to confirm). Nothing changed.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
423errors/x_account_locked: X shows the account its lock page (x.com/account/access). Nothing was done; someone has to pass X's check.
›
errors/x_account_locked: X shows the account its lock page (x.com/account/access). Nothing was done; someone has to pass X's check.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
429errors/follow_limited: X says the account can't follow more people right now.
›
errors/follow_limited: X says the account can't follow more people right now.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
501errors/feature_not_implemented: a LinkedIn account.
›
errors/feature_not_implemented: a LinkedIn account.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
502errors/follow_unconfirmed or errors/unfollow_unconfirmed: check the profile; doing it again changes nothing.
›
errors/follow_unconfirmed or errors/unfollow_unconfirmed: check the profile; doing it again changes nothing.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
503errors/service_unavailable (the account isn't ready, or the browser runner can't be reached), errors/no_client_session, or errors/maintenance with retry_at.
›
errors/service_unavailable (the account isn't ready, or the browser runner can't be reached), errors/no_client_session, or errors/maintenance with retry_at.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
504errors/timeout.
›
errors/timeout.application/problem+json
typestringrequiredtitlestringstatusintegerrequireddetailstringretry_atstring · date-timecodestringThe browser's own reason, when it refused before the click:
replies_limited,post_not_accepted,gif_not_found,browser_busy…
Was this page helpful?