# Referral by code

`GET https://api.nexus.gg/v1/referrals/code/{code}`

Looks up a group member by their referral code and returns their referral codes, plus the paginated list of `referrals` credited to those codes. A code with no approved, group-linked Nexus behind it returns `400` with `CodeNotInGroup`. Pass `excludeReferralList=true` to skip the referral history and get only the codes and member summary; when set, `currentPage`, `currentPageSize`, `totalCount`, and `referrals` are left out of the response entirely.

## Authorizations

- `X-SHARED-SECRET` (string, header, required) - Send your **public** API key (`nexus_pk_...`) in the `X-SHARED-SECRET` header. [Generate one](/authentication/api-keys/) in the Publisher Dashboard.

## Path parameters

- `code` (string, required) - The creator's referral code to look up. Matched case-insensitively.

## Query parameters

- `groupId` (string) - Creator group to use for this operation. If your key is scoped to a single program, that group is always used regardless of this value; otherwise falls back to your default group when omitted.
- `page` (integer) - Page of records to return
- `pageSize` (integer) - Maximum number of records to return
- `excludeReferralList` (boolean) - If set to true, `referrals` are not retrieved and the response omits `currentPage`, `currentPageSize`, `totalCount`, and `referrals` entirely.

## Responses

### 200

Referral code info requested

#### Body (`application/json`)

- `groupId` (string) - ID of the creator group
- `groupName` (string) - Name of the creator group
- `referralCodes` (array of object)
- `playerId` (string) - Your own identifier for this creator, from `externalRef`. Set when you link a Nexus to a player ID.
- `currentPage` (integer) - Page number of response records returned
- `currentPageSize` (integer) - Page size used for this operation
- `totalCount` (integer) - Total number of referrals for this code
- `referrals` (array of object)

### 400

Bad request

#### Body (`application/json`)

- `code` (string) - CodeNotInGroup: Creator group is private, and specified code is not linked to it<br /> InvalidGroup: No creator group was found with the specified groupId<br/> InvalidAuthCode: AuthCode provided is not valid<br/> ExpiredAuthCode: AuchCode provided has expired<br/> ReferralNexusNotFound: No Nexus was found to match the provided referral code Allowed values: InvalidGroup, CodeNotInGroup, InvalidAuthCode, ExpiredAuthCode, ReferralNexusNotFound, UnknownError.
- `message` (string)
