> ## Documentation Index
> Fetch the complete documentation index at: https://replyke-feat-push-rich-payload-fields.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch following by user ID

> Fetch the following list for any user by their ID

## Overview

Returns a function that fetches the paginated list of users that a given user follows, identified by `userId`. This is a public endpoint — authentication is not required.

For fetching your own following list, see `useFetchFollowing`.

## Usage Example

```tsx theme={null}
import { useFetchFollowingByUserId } from "@sublay/react-js";

function UserFollowing({ userId }: { userId: string }) {
  const fetchFollowingByUserId = useFetchFollowingByUserId();
  const [following, setFollowing] = useState([]);

  useEffect(() => {
    fetchFollowingByUserId({ userId, page: 1 }).then((res) => {
      setFollowing(res.data);
    });
  }, [userId]);

  return (
    <ul>
      {following.map(({ followId, user }) => (
        <li key={followId}>{user.name}</li>
      ))}
    </ul>
  );
}
```

## Parameters

The hook returns a function. That function accepts:

<ParamField path="userId" type="string" required>
  The ID of the user whose following list to fetch.
</ParamField>

<ParamField path="page" type="number">
  Page number to fetch. Defaults to `1`.
</ParamField>

<ParamField path="limit" type="number">
  Number of results per page. Defaults to `20`.
</ParamField>

<ParamField path="spaceReputationId" type="string">
  Resolves each followed user's reputation into a `spaceReputation` number on the embedded `user`. Accepts a space `<uuid>` or `"none"` (project-general bucket) only — `"context"` is rejected with a `400` on this endpoint. Empty string, `"general"`, and `null` are also rejected. See [Reputation](/data-models/reputation).
</ParamField>

<ParamField path="spaceReputationDescendants" type="boolean">
  When `true`, `spaceReputation` is the subtree sum (the space plus all its descendants). Only honored when `spaceReputationId` is an explicit `<uuid>`.
</ParamField>

## Returns

Returns a `PaginatedResponse` containing an array of following entries:

<ResponseField name="data" type="FollowingWithFollowInfo[]">
  Array of following entries.

  <Expandable title="FollowingWithFollowInfo properties">
    <ResponseField name="followId" type="string">
      ID of the follow record.
    </ResponseField>

    <ResponseField name="user" type="User">
      The followed user's profile. When `spaceReputationId` is set, it carries an added `spaceReputation` number. See [User data model](/data-models/user) and [Reputation](/data-models/reputation).
    </ResponseField>

    <ResponseField name="followedAt" type="string">
      ISO timestamp of when the follow was created.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination metadata including `currentPage`, `totalPages`, `totalCount`, `hasNextPage`, and `hasPreviousPage`.
</ResponseField>

## Related

* [useFetchFollowing](/hooks/follows/use-fetch-following) — fetch the current user's own following list
* [useFetchFollowingCountByUserId](/hooks/follows/use-fetch-following-count-by-user-id) — get following count for a user
