> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Follows

> The Follows endpoints let you follow and unfollow users, and retrieve follower and following. Reference for the X API v2 standard tier covering follows.

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

The Follows endpoints let you follow and unfollow users, and retrieve follower and following lists for any user.

## Overview

<CardGroup cols={2}>
  <Card title="Follow" icon="user-plus">
    Follow a user on behalf of the authenticated user
  </Card>

  <Card title="Unfollow" icon="user-minus">
    Unfollow a user
  </Card>

  <Card title="Followers" icon="users">
    Get a user's followers
  </Card>

  <Card title="Following" icon="user-group">
    Get who a user follows
  </Card>
</CardGroup>

***

## Endpoints

### Follows lookup

| Method | Endpoint                                               | Description            |
| :----- | :----------------------------------------------------- | :--------------------- |
| GET    | [`/2/users/:id/followers`](/x-api/users/get-followers) | Get a user's followers |
| GET    | [`/2/users/:id/following`](/x-api/users/get-following) | Get who a user follows |

### Manage follows

| Method | Endpoint                                                                           | Description     |
| :----- | :--------------------------------------------------------------------------------- | :-------------- |
| POST   | [`/2/users/:id/following`](/x-api/users/follow-user)                               | Follow a user   |
| DELETE | [`/2/users/:source_user_id/following/:target_user_id`](/x-api/users/unfollow-user) | Unfollow a user |

***

## Example: Get followers

```bash theme={null}
curl "https://api.x.com/2/users/2244994945/followers?\
user.fields=username,verified,public_metrics" \
  -H "Authorization: Bearer $BEARER_TOKEN"
```

## Example: Follow a user

```bash theme={null}
curl -X POST "https://api.x.com/2/users/123456789/following" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target_user_id": "2244994945"}'
```

***

## Getting started

<Note>
  **Prerequisites**

  * An approved [developer account](https://developer.x.com/en/portal/petition/essential/basic-info)
  * A [Project and App](/resources/fundamentals/developer-apps) in the Developer Console
  * Your App's [keys and tokens](/resources/fundamentals/authentication)
</Note>

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/x-api/users/follows/quickstart">
    Get started with follows
  </Card>

  <Card title="API Reference" icon="code" href="/x-api/users/get-followers">
    Full endpoint documentation
  </Card>

  <Card title="Sample code" icon="github" href="https://github.com/xdevplatform/Twitter-API-v2-sample-code">
    Working code examples
  </Card>
</CardGroup>
