Skip to main content

Create Guild Tournament

Create a tournament request for your guild. Requires the guilds.owner permission.

Endpoint

POST /api/v2/guild-tournaments

Authentication

This endpoint requires:

  1. JWT Token: User authentication
  2. Permission: guilds.owner role (you must own a guild)
Authorization: Bearer user-jwt-token-here

Description

Creates a new guild tournament request. The tournament is submitted for review and starts in pending status. Once accepted by a reviewer, you can launch it. The requestedBy field is automatically set to the authenticated user.

Request Body

FieldTypeRequiredDescription
guildIdstringYesYour guild ID
namestringYesTournament name (min 5 chars)
slugstringYesURL-friendly identifier
colorstringYesHex color (e.g. #FF5733)
imagestringYesTournament image URL
organizationIdstringYesOrganization ID
projectsIdsstring[]YesProject IDs
startDatenumberYesStart timestamp (Unix ms)
endDatenumberYesEnd timestamp (Unix ms)
airdropsIdsstring[]YesAirdrop IDs
stakesIdsstring[]YesStake IDs
gameIdstringYesGame ID
totalWinnersnumberYesNumber of winners
totalPrizenumberYesTotal prize amount
prizeDistributionTypestringYesautomatic or manual
isPracticebooleanYesWhether practice mode is enabled
roundsobject[]NoRound configurations (see below)

Round Object (optional)

FieldTypeRequiredDescription
namestringYesRound name
titlestringYesRound title
projectsIdsstring[]YesProject IDs for this round
intervalsobject[]Yes{ startDate, endDate }
playerStandingsobject[]YesPlayer standing configuration
projectStandingobjectYesProject standing configuration

Request Example

{
"guildId": "guild-123",
"name": "My Guild Championship",
"slug": "my-guild-championship",
"color": "#FF5733",
"image": "https://example.com/banner.png",
"organizationId": "org-456",
"projectsIds": ["project-1"],
"startDate": 1704067200000,
"endDate": 1704153600000,
"airdropsIds": [],
"stakesIds": [],
"gameId": "game-789",
"totalWinners": 10,
"totalPrize": 1000,
"prizeDistributionType": "automatic",
"isPractice": false
}

Response

Success Response (201)

Returns the created guild tournament object with status: "pending".

Error Response (400)

{
"message": "Validation error",
"status": 400
}

Error Response (401)

{
"message": "Unauthorized",
"status": 401
}

Error Response (403)

{
"message": "Forbidden",
"status": 403
}

Usage Example

const response = await fetch("https://api-stage.intraverse.io/api/v2/guild-tournaments", {
method: "POST",
headers: {
Authorization: `Bearer ${jwtToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
guildId: "guild-123",
name: "My Guild Championship",
slug: "my-guild-championship",
color: "#FF5733",
image: "https://example.com/banner.png",
organizationId: "org-456",
projectsIds: ["project-1"],
startDate: Date.now() + 86400000,
endDate: Date.now() + 172800000,
airdropsIds: [],
stakesIds: [],
gameId: "game-789",
totalWinners: 10,
totalPrize: 1000,
prizeDistributionType: "automatic",
isPractice: false,
}),
});

const tournament = await response.json();
console.log(`Created tournament: ${tournament.id} (${tournament.status})`);

Next Steps