Booking · Tournaments
Get the tournament an event would become
Returns what a tournament created from an event takes over: its name, days, place, picture, color and tags, a category for each of its rates, and how many confirmed sign-ups would become teams. Only events with a single date that teams register for, and that belong to no tournament, can become one.
Permissions
Send an API key of the organization in the path, using the X-API-Key header.
Permission checks in detail
Required permissions
mandate.readtournament.readevent.read
Request
Path parameters
-
organizationIdidrequired -
mandateIdidrequired -
eventIdidrequired
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
--request GET 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/booking/events/YOUR_EVENT_ID/tournamentDraft' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/booking/events/YOUR_EVENT_ID/tournamentDraft", {
method: "GET",
headers: {
"X-API-Key": "YOUR_API_KEY"
},
redirect: 'error',
signal: AbortSignal.timeout(30_000),
});
if (!response.ok) throw new Error(`campai HTTP ${response.status}`);
const text = await response.text();
const result = text ? JSON.parse(text) : null;
console.log(JSON.stringify(result, null, 2));<?php
$context = stream_context_create(['http' => [
'method' => 'GET',
'header' => [
'X-API-Key: YOUR_API_KEY',
],
'timeout' => 30,
'follow_location' => 0,
'ignore_errors' => true,
]]);
$text = @file_get_contents('https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/booking/events/YOUR_EVENT_ID/tournamentDraft', false, $context);
preg_match('/^HTTP\/\S+ (\d{3})/', $http_response_header[0] ?? '', $match);
$status = (int) ($match[1] ?? 0);
if ($text === false || $status < 200 || $status >= 300) {
throw new RuntimeException("campai HTTP $status (0 means no response)");
}
$result = $text === '' ? null : json_decode($text, true, 512, JSON_THROW_ON_ERROR);
echo json_encode($result, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
Response
200 Successful response
Content-Type: application/json
-
namestring1–60 characters
-
descriptionstringat most 140 characters
-
imageobjectnullable4 properties
-
resourcestringat least 1 characters
-
fileNamestringat most 128 characters
-
contentTypestringat most 75 characters
-
fileSizeBytesintegerat least 0
-
-
colorstring -
tagsstring[]at most 10 items · each 1–40 characters
-
placeobjectnullable5 properties
-
typestringresourceaddressonline -
resourceobject6 properties
-
siteid -
siteNamestringat least 1 characters
-
siteAddressobject7 properties
-
countrystring -
statestring -
zipstringat most 10 characters
-
citystringat most 45 characters
-
addressLinestringat most 45 characters
-
details1stringat most 45 characters
-
details2stringat most 45 characters
-
-
resourceid -
resourceNamestring -
quantityinteger
-
-
addressobject7 properties
-
countrystring -
statestring -
zipstringat most 10 characters
-
citystringat most 45 characters
-
addressLinestringat most 45 characters
-
details1stringat most 45 characters
-
details2stringat most 45 characters
-
-
locationobjectnullable2 properties
-
latitudenumber-90–90
-
longitudenumber-180–180
-
-
onlineobject2 properties
-
urlstring · uriat most 300 characters
-
instructionsstringat most 400 characters
-
-
-
timezonestringat least 1 characters
-
daysobject[]1–14 items
2 properties
-
datestring -
startobject2 properties
-
hoursinteger0–23
-
minutesinteger0–59
-
-
-
participantTypestringteamperson -
divisionsobject[]6 properties
-
rateIdstringnullableexactly 8 characters
-
namestring1–40 characters
-
shortNamestring1–8 characters
-
colorstring -
maxTeamsintegernullableat most 512
-
teamsintegerat least 0
-
-
eventobject3 properties
-
_idid -
mandateid -
periodobject4 properties
-
fromstring · date-time -
tostring · date-time -
statusstringavailableblockedResourceblockedCalendar -
warningstringnoAvailableExtendedPeriod
-
-
{
"name": "string",
"description": "string",
"image": {
"resource": "string"
},
"color": "",
"tags": [
"string"
],
"place": {
"type": "resource"
},
"timezone": "string",
"days": [
{
"date": "string",
"start": {
"hours": 0,
"minutes": 0
}
}
],
"participantType": "team",
"divisions": [
{
"rateId": "string",
"name": "string",
"shortName": "string",
"color": "",
"maxTeams": 1,
"teams": 0
}
],
"event": {
"_id": "000000000000000000000001",
"mandate": "000000000000000000000001",
"period": {
"from": "2026-06-15T22:30:00Z",
"to": "2026-06-15T22:30:00Z",
"status": "available"
}
}
}
Errors
No errors of its own are known for this endpoint.
Errors nearly every request can meet are listed under Errors.