# 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`.


---

# Agent Instructions: 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:

```
GET https://dupr.gitbook.io/dupr-raas/integration-checklist/club-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
