> For the complete documentation index, see [llms.txt](https://docs.perkville.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.perkville.com/integrations/integrating-perkville/integrating-your-app-with-perkville/referral-page/referred-prospects.md).

# Referred prospects

Use the [**Referrals** endpoint](https://www.perkville.com/developers/docs/v2/#v2_resource_25_anchor) to show the people a member referred and each referral’s status.

<figure><img src="https://2181708597-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSiE75SeColbiBVbet0NZ%2Fuploads%2Fr6N0ZQxDQeIOjK4MxU5L%2Freferred_prospects_Perkville_page.png?alt=media&amp;token=86341d6f-de3d-47df-baad-98dfb9d81c93" alt="" width="372"><figcaption></figcaption></figure>

### How to generate it

Use the following workflow for each page of referred prospects.

1. **Fetch the member’s referrals.** Filter the Referrals endpoint for the signed-in member.
2. **Collect referee IDs.** Read the `referral_to_user` value for every referral returned.
3. **Fetch referee details in one request.** Call the Users endpoint with `user_id__in` set to the collected IDs.
4. **Match users to referrals.** Join each User response to its referral using `referral_to_user`.
5. **Render and paginate the results.** Show the referee’s details with the referral status. Use the Referrals response to determine whether another page exists.

This requires two requests per results page: one to Referrals and one to Users. Do not request each referee individually.

#### Pagination

Paginate the Referrals endpoint first. Then batch-fetch only the referees shown on that page.

When the member opens the next page, repeat the same two requests with the next Referrals page. This avoids loading every referral and user record upfront.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.perkville.com/integrations/integrating-perkville/integrating-your-app-with-perkville/referral-page/referred-prospects.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
