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

# Tournaments

Tournament organization, brackets, and competitive match management.

## Get available tournament formats

> Retrieves all available tournaments formats for the active provider

```json
{"openapi":"3.0.0","info":{"title":"PodPlay Inc API","version":"2.0"},"tags":[{"name":"Tournaments","description":"Tournament organization, brackets, and competitive match management."}],"servers":[{"url":"/apis/v2","description":"Current Server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"TournamentFormatsResponseDto":{"type":"object","properties":{"provider":{"type":"string","enum":["SWISH","PODPLAY"]},"formats":{"description":"Available tournament formats for the provider","type":"array","items":{"type":"object"}}},"required":["provider","formats"]}}},"paths":{"/tournaments/formats":{"get":{"operationId":"TournamentsController_getEventFormats","summary":"Get available tournament formats","description":"Retrieves all available tournaments formats for the active provider","parameters":[],"responses":{"200":{"description":"Tournament formats retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TournamentFormatsResponseDto"}}}}},"tags":["Tournaments"]}}}}
```

## Generate tournament webview JWT token

> Returns a signed JWT token for accessing tournament webview with appropriate scope based on user roles

```json
{"openapi":"3.0.0","info":{"title":"PodPlay Inc API","version":"2.0"},"tags":[{"name":"Tournaments","description":"Tournament organization, brackets, and competitive match management."}],"servers":[{"url":"/apis/v2","description":"Current Server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"TournamentWebviewTokenDto":{"type":"object","properties":{"token":{"type":"string","description":"JWT token for tournament webview access"},"expiresAtDate":{"type":"string","description":"Token expiration timestamp (ISO 8601)"}},"required":["token","expiresAtDate"]}}},"paths":{"/tournaments/webview-token":{"post":{"operationId":"TournamentsController_getWebviewToken","summary":"Generate tournament webview JWT token","description":"Returns a signed JWT token for accessing tournament webview with appropriate scope based on user roles","parameters":[],"responses":{"200":{"description":"JWT token generated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TournamentWebviewTokenDto"}}}}},"tags":["Tournaments"]}}}}
```

## Manually trigger a tournament division update

> Force the manual update of a tournament division

```json
{"openapi":"3.0.0","info":{"title":"PodPlay Inc API","version":"2.0"},"tags":[{"name":"Tournaments","description":"Tournament organization, brackets, and competitive match management."}],"servers":[{"url":"/apis/v2","description":"Current Server"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"TournamentDivisionDto":{"type":"object","properties":{"id":{"type":"string","description":"Tournament Division ID","readOnly":true},"tournament":{"description":"Tournament ID","readOnly":true,"allOf":[{"$ref":"#/components/schemas/ItemRefDto"}]},"provider":{"type":"string","enum":["SWISH","PODPLAY"]},"swish":{"description":"Tournament data specific to Swish","allOf":[{"$ref":"#/components/schemas/SwishDto"}]},"podplay":{"description":"Tournament data specific to PodPlay","allOf":[{"$ref":"#/components/schemas/PodPlayTournamentDto"}]},"status":{"type":"string","enum":["DRAFT","SUCCESS","FAILED"],"description":"Current status of the tournament","readOnly":true},"createdAt":{"format":"date-time","type":"string","description":"When the tournament was created","readOnly":true},"event":{"description":"ID of the event the tournament is associated with","readOnly":true,"allOf":[{"$ref":"#/components/schemas/ItemRefDto"}]},"lastSyncedAt":{"format":"date-time","type":"string","description":"Last time the tournament was synced with the provider"},"visibility":{"type":"string","enum":["HIDDEN","VISIBLE"],"description":"Visibility status: HIDDEN (admin only), VISIBLE (shown to users), or null"},"_links":{"type":"object","readOnly":true}},"required":["id","tournament","provider","event","_links"]},"ItemRefDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the resource"}},"required":["id"]},"SwishDto":{"type":"object","properties":{"eventFormat":{"type":"string","enum":["regular_play","rotating_partners_round_robin","set_partners_round_robin","mixed_gender_round_robin","custom_team_format","minor_league_pickleball_round_robin","king_of_the_court","league-rotating_partners_round_robin","league-set_partners_round_robin","league-mixed_gender_round_robin","ladder-league-rotating_partners_round_robin","league-king_of_the_court","league-custom_team_format","league-minor_league_pickleball_round_robin"]},"gameId":{"type":"string"},"editPlayersPath":{"type":"string"}},"required":["eventFormat","editPlayersPath"]},"PodPlayTournamentDto":{"type":"object","properties":{"eventFormat":{"type":"string","description":"The event format for PodPlay tournaments"},"gameId":{"type":"string","description":"Game ID from PodPlay provider"},"url":{"type":"string","description":"URL to the tournament in PodPlay provider"}},"required":["eventFormat","url"]}}},"paths":{"/tournaments/sync/{tournamentDivisionId}":{"post":{"operationId":"TournamentsController_updateGame","summary":"Manually trigger a tournament division update","description":"Force the manual update of a tournament division","parameters":[{"name":"tournamentDivisionId","required":true,"in":"path","schema":{"type":"string"}}],"responses":{"200":{"description":"Game updated successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TournamentDivisionDto"}}}}},"tags":["Tournaments"]}}}}
```


---

# 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.podplay.app/api/tournaments.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.
