> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/apis/apis/rewards/referrals.md).

# Referrals

Referral system operations

## Get user referrals

> Retrieve referrals made by the authenticated user

```json
{"openapi":"3.0.3","info":{"title":"Decentraland Referral Service API","version":"1.0.0"},"tags":[{"name":"Referrals","description":"Referral system operations"}],"servers":[{"url":"https://rewards.decentraland.org","description":"Production server"},{"url":"https://rewards.decentraland.zone","description":"Development server"},{"url":"http://localhost:8000","description":"Local Development server"}],"security":[],"paths":{"/api/referrals":{"get":{"tags":["Referrals"],"summary":"Get user referrals","description":"Retrieve referrals made by the authenticated user","responses":{"200":{"description":"User referrals","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"data":{"type":"array","items":{"type":"object","required":["user","referral_of","created_at"],"properties":{"user":{"type":"string","format":"address","description":"User address"},"referral_of":{"type":"string","format":"address","description":"Address of the user who made the referral"},"created_at":{"type":"string","format":"date-time","description":"Referral creation time"}}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}}}}}}}
```

## Get referral information

> Get referral information for the authenticated user

```json
{"openapi":"3.0.3","info":{"title":"Decentraland Referral Service API","version":"1.0.0"},"tags":[{"name":"Referrals","description":"Referral system operations"}],"servers":[{"url":"https://rewards.decentraland.org","description":"Production server"},{"url":"https://rewards.decentraland.zone","description":"Development server"},{"url":"http://localhost:8000","description":"Local Development server"}],"security":[],"paths":{"/api/referralOf":{"get":{"tags":["Referrals"],"summary":"Get referral information","description":"Get referral information for the authenticated user","responses":{"200":{"description":"Referral information","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"data":{"type":"object","required":["user","referral_of","created_at"],"properties":{"user":{"type":"string","format":"address","description":"User address"},"referral_of":{"type":"string","format":"address","description":"Address of the user who made the referral"},"created_at":{"type":"string","format":"date-time","description":"Referral creation time"}}}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}}}}}}}
```

## Create referral

> Create a referral relationship for the authenticated user

```json
{"openapi":"3.0.3","info":{"title":"Decentraland Referral Service API","version":"1.0.0"},"tags":[{"name":"Referrals","description":"Referral system operations"}],"servers":[{"url":"https://rewards.decentraland.org","description":"Production server"},{"url":"https://rewards.decentraland.zone","description":"Development server"},{"url":"http://localhost:8000","description":"Local Development server"}],"security":[],"paths":{"/api/referralOf":{"post":{"tags":["Referrals"],"summary":"Create referral","description":"Create a referral relationship for the authenticated user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","format":"address","description":"Address of the user who made the referral"},"code":{"type":"string","description":"Referral code"}}}}}},"responses":{"201":{"description":"Referral created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"data":{"type":"object","required":["user","referral_of","created_at"],"properties":{"user":{"type":"string","format":"address","description":"User address"},"referral_of":{"type":"string","format":"address","description":"Address of the user who made the referral"},"created_at":{"type":"string","format":"date-time","description":"Referral creation time"}}}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","description":"Whether the request was successful"},"error":{"type":"string","description":"Error message"},"code":{"type":"string","description":"Error code"},"data":{"type":"object","description":"Additional error data"}}}}}}}}}}}
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decentraland.org/apis/apis/rewards/referrals.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
