Skip to content
Docs

Follow an account, or unfollow it

Early access. Tell us what you're building and we'll set you up. Contact us

POSTapi.lempile.com/users/follow

Follows 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-Keystring

    Optional. With a key, the write gets a receipt (GET /writes/{key}) and a repeat replays the first answer.

    ≤ 200 chars

Request body

  • account_idstringrequired
  • identifierstringrequired

    The X handle to follow (or, with undo, to unfollow), with or without @.

    Pattern^@?[A-Za-z0-9_]{1,15}$
  • undoboolean

    true unfollows the account. true or false only: any other value answers 400. X only (a LinkedIn account answers 501).

    Defaultfalse

Responses

200

Followed, or (with undo) unfollowed.

›

application/json

  • UserFollowedUserFollowed
    ›Show fields
    • objectany
      AlwaysUserFollowed
    • providerany
      AlwaysX
    • identifierstring
    • alreadyboolean
  • UserUnfollowedUserUnfollowed
    ›Show fields
    • objectany
      AlwaysUserUnfollowed
    • providerany
      AlwaysX
    • identifierstring
    • alreadyboolean

      true: the account didn't follow it; nothing was pressed.

400

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

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

401

Missing or invalid API key ({error, message}), errors/disconnected_account, or errors/reauth_required when X is signed out in the account's browser.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

402

subscription_required: the workspace has no active trial or subscription.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

404

errors/user_not_found.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

422

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

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

423

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

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

429

errors/follow_limited: X says the account can't follow more people right now.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

501

errors/feature_not_implemented: a LinkedIn account.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

502

errors/follow_unconfirmed or errors/unfollow_unconfirmed: check the profile; doing it again changes nothing.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

503

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

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

504

errors/timeout.

›

application/problem+json

  • typestringrequired
  • titlestring
  • statusintegerrequired
  • detailstring
  • retry_atstring · date-time
  • codestring

    The browser's own reason, when it refused before the click: replies_limited, post_not_accepted, gif_not_found, browser_busy…

Was this page helpful?