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:
- JWT Token: User authentication
- Permission:
guilds.ownerrole (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
| Field | Type | Required | Description |
|---|---|---|---|
guildId | string | Yes | Your guild ID |
name | string | Yes | Tournament name (min 5 chars) |
slug | string | Yes | URL-friendly identifier |
color | string | Yes | Hex color (e.g. #FF5733) |
image | string | Yes | Tournament image URL |
organizationId | string | Yes | Organization ID |
projectsIds | string[] | Yes | Project IDs |
startDate | number | Yes | Start timestamp (Unix ms) |
endDate | number | Yes | End timestamp (Unix ms) |
airdropsIds | string[] | Yes | Airdrop IDs |
stakesIds | string[] | Yes | Stake IDs |
gameId | string | Yes | Game ID |
totalWinners | number | Yes | Number of winners |
totalPrize | number | Yes | Total prize amount |
prizeDistributionType | string | Yes | automatic or manual |
isPractice | boolean | Yes | Whether practice mode is enabled |
rounds | object[] | No | Round configurations (see below) |
Round Object (optional)
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Round name |
title | string | Yes | Round title |
projectsIds | string[] | Yes | Project IDs for this round |
intervals | object[] | Yes | { startDate, endDate } |
playerStandings | object[] | Yes | Player standing configuration |
projectStanding | object | Yes | Project 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})`);