Manage Tournaments through the API
List tournaments​
Required permission: organization:tournament:view
GraphQL Query:
query {
tournaments(
query: {
orderBy: START_AT # The field you want to use for the ordering
orderDirection: DESC # The order of the ordering
status: REGISTRATIONS_OPEN # The status of the tournament
}
page: {
cursor: "pageCursor" # Cursor for the next page provided by a previous request
size: 100 # Elements count to retrieve
}
) {
nextPageCursor # Cursor for the next page
data { # Tournaments list
id # Tournament id
title # Tournament title
description # Tournament description
}
}
}
Get a tournament​
Required permission: organization:tournament:view
GraphQL Query:
query {
tournament(
id: "tournamentId" # The ID of the tournament to retrieve
) {
id # Tournament id
description # Tournament description
startRegistrationsAt # Registration open date
endRegistrationsAt # Registration close date
startAt # Tournament start date
endAt # Tournament end date
myTeam { # Current user's team if the user has a registered team
id # Team ID
status # Registration status
name # Team name
tag # Team tag
members { # Team members
status # Member status
player {
id # Player profile id
organizationCustomId # Organization custom ID for the player
profilePicUrl # Player profile picture
username # Player username
}
}
}
# Retrieve teams
teams(
status: VALIDATED # Optional filter of the teams status
page: {
size: 100 # Amount to retrieve
cursor: "nextPageCursor" # Next page cursor, provided by older request
}
) {
nextPageCursor # The page cursor for the next page
data { # Teams list
id # Team ID
status # Registration status
name # Team name
tag # Team tag
members { # Team members
status # Member status
player {
id # Player profile id
organizationCustomId # Organization custom ID for the player
profilePicUrl # Player profile picture
username # Player username
}
}
}
}
# Retrieve steps
steps {
id # Step ID
description # Step description
name # Step name
type # Step type
order # Step order
# Retrieve step groups
groups {
id # Groups ID
name # Groups name
description # Group description
# Retrieve group rounds
rounds {
id # Round ID
name # Round name
# Retrieve group games
games {
id # Game ID
order # Game order
status # Game status
# Retrieve game matches
matches {
id # Match ID
status # Match status
order # Match order
# Retrieve match scores
scores {
status # Score status
score # Score
# Retrieve the team that the score is linked to
team {
id # Team ID
name # Team name
tag # Team tag
}
}
}
}
}
}
}
}
}
Create a tournament​
Required permission: organization:tournament:create
GraphQL Mutation:
mutation {
createTournament(
input: {
title: "Tournament title" # Tournament title
description: "Tournament description" # The tournament description shown on the public page (can contain HTML)
startRegistrationsAt: "2022-01-01" # Opening of the registrations
endRegistrationsAt: "2022-01-02" # Closing of the registrations
startAt: "2022-01-03" # Start of the tournament
endAt: "2022-01-04" # End of the tournament
configuration: { # Tournament configuration
configuration: {
teamMaxSize: 1 # Max team size
teamMinSize: 1 # Min team size
teamsCount: 10 # Maximum teams that can register
# The status to set after the team registered and passed the registration conditions
# REGISTERED - Means that the team is registered on the tournament, but not validated
# VALIDATED - The team is validated and does not need to be manually validated
teamStatusAfterRegistration: REGISTERED
# The registration rules that you want to apply
registrationConditions: {
# Each team member must validate these conditions
memberConditions: [
{
# From where to retrieve the property, this can be either from Player Profile (PLAYER)
# or via an external identity linked to the player account properties
propertySource: IDENTITY_PROVIDER
# Use the following ID only when using IDENTITY_PROVIDER propertySource
propertySourceId: "identityProviderID"
condition: {
# The name of the property to check
property: "propertyKey"
propertyCondition: EXISTS # Force a check to see if the condition exists or not
# A numeric condition is used to validate numerical values
numericCondition: {
value: 1234
conditionType: LT
}
# OR a string condition
stringCondition: {
conditionType: NEQ
value: "Value"
}
}
}
]
# The team as a hole must validate these conditions
teamConditions: [{
# The name of the property to check
property: "propertyKey"
propertyCondition: EXISTS # Force a check to see if the condition exists or not
# A numeric condition is used to validate numerical values
numericCondition: {
value: 1234
conditionType: LT
# If you add the following values, you will execute an aggregation
# on all team members using the property you have chosen.
# The property will be extracted from members, and not from the team
# properties
aggregationType: SUM
# If you dont set the following variables, player properties will
# be used instead
propertySource: IDENTITY_PROVIDER
# Value needed if "IDENTITY_PROVIDER" is selected
propertySourceId: "propertySourceID"
}
# OR a string condition
stringCondition: {
conditionType: NEQ
value: "Value"
}
}]
}
}
# OR load existing saved configuration
fromId: "configurationToLoadID"
}
}
) {
id # Newly created tournament ID
}
}
Create a step​
Required permission: organization:tournament:step:create
GraphQL Mutation:
mutation {
createStep(
# The tournament where you want to create this step
tournamentId: "tournamentID"
# Step informations
step: {
name: "Step name"
description: "Step description"
order: 0 # Step order
type: SCORE # Step type
}
# Step configuration
configuration: {
# TODO
}
) {
id # The newly created step ID
}
}
Generate a step​
Required permission: organization:tournament:step:generate
GraphQL Mutation:
mutation {
generateStep(
stepId: "stepId" # The step ID to generate
)
}
Seed a step​
Required permission: organization:tournament:step:seed
GraphQL Mutation:
mutation {
seedStep(
stepId: "stepID" # The stepID to seed
input: { # You have to either choose "automatic seeding" or "manual seeding"
# WellPlayed will automatically seed your step with validated teams
automaticSeeding: {
groupRepartitionMechanism: BALANCED # The repartition mechanism to use between groups
seedingMechanism: PAIR_FLIP # The seeding ordering to use
}
# OR you can manually seed your groups
manualSeeding: {
groups: [
{
group: "groupId" # The group to seed ID
teams: [ # Teams IDs to add to this group, THE ORDER IS IMPORTANT
"teamID1"
"teamID2"
]
}
]
}
}
)
}
Update teams registration status​
Required permission: organization:tournament:team:status:update
GraphQL Mutation:
mutation {
updateTournamentTeamStatus(
status: VALIDATED # New status to set for the team
tournamentTeamId: "TeamID" # The Team ID
) {
id # Team ID
status # New Team status
name # Team name
}
}
Update matches​
Required permission: organization:tournament:match:score:update
GraphQL Mutation:
mutation {
updateMatchScores(
input: {
status: WINNER # New score status to set
forcedScoreValue: 1234 # OPTIONAL Force a new score value (will bypass the score calculation formula)
teamId: "teamId" # The team that you want to update the score for
variables: [ # Updated variables values
{
formulaName: "variableName" # Variable name in the calculation formula
value: 1234 # Variable value
}
]
}
matchId: "matchID" # The match ID
) {
id # Match ID
status # New match status
}
}