Skip to main content

List My Guild Tournaments

Retrieve a paginated list of tournaments for your guild. Requires the guilds.owner permission.

Endpoint

GET /api/v2/guild-tournaments/my

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

Returns a paginated list of guild tournaments for the guild you own. Automatically filters to your guild's tournaments only.

Query Parameters

ParameterTypeRequiredDescription
sizenumberYesNumber of items per page (min: 1, max: 30)
keystringNoCursor key for pagination
directionstringNoCursor direction: forward or backward
orderstringNoSort order: asc or desc
orderBystringNoField to sort by
statusstringNoFilter by status: pending, accepted, rejected

Request Example

GET /api/v2/guild-tournaments/my?size=10

With status filter

GET /api/v2/guild-tournaments/my?size=10&status=accepted

Response

Success Response (200)

{
"current": {
"size": 10,
"key": null,
"direction": null,
"order": "asc",
"orderBy": null,
"query": null
},
"previous": null,
"next": null,
"data": [
{
"id": "gt-123",
"guildId": "guild-456",
"guildName": "Elite Gamers",
"name": "My Guild Championship",
"status": "accepted",
"requestedBy": "user-789",
"startDate": 1704067200000,
"endDate": 1704153600000,
"createdAt": 1704060000000,
"updatedAt": 1704060000000,
"tournamentId": "tournament-abc"
}
]
}

Error Response (401)

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

Error Response (403)

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

Error Response (404)

{
"message": "You don't have a guild",
"status": 404
}

Tournament Statuses

StatusDescription
pendingAwaiting review
acceptedApproved; ready to launch
rejectedRejected by reviewer
launchedTournament launched

Usage Example

const response = await fetch("https://api.intraverse.io/api/v2/guild-tournaments/my?size=10&status=accepted", {
headers: {
Authorization: `Bearer ${jwtToken}`,
},
});

const result = await response.json();

result.data.forEach((t) => {
console.log(`${t.name} - ${t.status}`);
});

Next Steps