> For the complete documentation index, see [llms.txt](https://dupr.gitbook.io/dupr-raas/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dupr.gitbook.io/dupr-raas/integration-checklist/club-integration.md).

# Club Integration

{% hint style="info" %}
**Testing:** Need a test club for development? See [How to Get a Test Club](/dupr-raas/reference/developer-faq.md#how-to-get-a-test-club) in the Developer FAQ.
{% endhint %}

## Club Membership Roles

To maintain data integrity, DUPR uses a role-based access system for clubs. Roles are returned as an ENUM within the `ClubMembership` object:

* `DIRECTOR`: The owner/primary administrator of the club.
* `ORGANIZER`: A manager with permissions to submit matches and manage events.
* `PLAYER`: A standard club member without administrative privileges.

{% hint style="warning" %}
**Administrative Requirement:** Only users with the **DIRECTOR** or **ORGANIZER** role are permitted to link a club to your platform or submit matches on behalf of that club.
{% endhint %}

## Fetching Club Membership

You must fetch a user's club membership and roles using the User Access Token obtained during the [SSO Login](/dupr-raas/integration-checklist/sso-login.md) flow.

<table><thead><tr><th width="174">Environment</th><th>API</th></tr></thead><tbody><tr><td>UAT</td><td><a href="https://api.uat.dupr.gg/api-explorer?group=public#/User/getClubMembership">UAT: Get Club Memberships</a></td></tr><tr><td>Production</td><td><a href="https://api.dupr.gg/api-explorer?group=public#/User/getClubMembership">Prod: Get Club Memberships</a></td></tr></tbody></table>

**Example Response Object:**

The endpoint returns an array of clubs the user is associated with:

```json
    { 
      "clubId": 1234567890,
      "clubName": "Club Name",
      "role": "DIRECTOR"
    }
```

* `clubId`: The unique numeric ID for the club (found in the club's DUPR URL).
* `clubName`: Human-readable name for display in your UI.

## Club Integration Requirements

When your platform interacts with DUPR Clubs, the following logic must be enforced:

* Match Source Validation: If a match is submitted with a `matchSource` of CLUB, the corresponding `clubId` must be included in the request.
* Role Gating: Before allowing a match submission, your backend must verify that the submittor holds an **ORGANIZER** or **DIRECTOR** role for that `clubId`.
