Booking · Tournaments
List tournaments
Returns the tournaments of a mandate with their days, place, categories and counts. A view narrows them to those that are upcoming or running, over, not published yet, canceled or archived; every view but the last leaves archived ones out.
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.read
Request
Path parameters
-
organizationIdidrequired -
mandateIdidrequired
Body
Content-Type: application/json
-
sortobject of stringThe keys to sort by, each with its direction. Sorting lists every key.
ascdesc -
limitinteger0–500 · default
50 -
offsetintegerat least 0 · default
0 -
returnCountbooleandefault
false -
viewstringdefault
"all"upcomingpastdraftcanceledarchivedall -
searchTermstring -
tagsstring[]each at least 1 characters
-
fromDatestring · date-time -
toDatestring · date-time -
hasEventboolean -
selectionobject2 properties
-
excludeIdsid[]1–1000 items
-
idsid[]1–1000 items
-
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
--request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/booking/tournaments/list' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/booking/tournaments/list", {
method: "POST",
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' => 'POST',
'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/tournaments/list', 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;
No request that worked has been recorded yet, so the body is not shown.
Sorting
sort takes the keys to sort by, each with asc or desc.
50 sort keys
| Key |
|---|
_id |
mandate |
shortId |
name |
description |
image.resource |
image.fileName |
image.contentType |
image.fileSizeBytes |
color |
tags |
place.type |
place.resource.site |
place.resource.siteName |
place.resource.siteAddress.country |
place.resource.siteAddress.state |
place.resource.siteAddress.zip |
place.resource.siteAddress.city |
place.resource.siteAddress.addressLine |
place.resource.siteAddress.details1 |
place.resource.siteAddress.details2 |
place.resource.resource |
place.resource.resourceName |
place.resource.quantity |
place.address.country |
place.address.state |
place.address.zip |
place.address.city |
place.address.addressLine |
place.address.details1 |
place.address.details2 |
place.location.latitude |
place.location.longitude |
place.online.url |
place.online.instructions |
timezone |
days |
period.from |
period.to |
participantType |
event |
statistics.teams |
statistics.matches |
statistics.scheduled |
statistics.finished |
publishedAt |
archivedAt |
divisions |
cancelation.canceledAt |
cancelation.reason |
Response
200 Successful response
Content-Type: application/json
-
countintegerat least 0
-
tournamentsobject[]19 properties
-
_idid -
mandateid -
shortIdstringexactly 6 characters
-
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
-
-
-
periodobject2 properties
-
fromstring · date-time -
tostring · date-time
-
-
participantTypestringteamperson -
eventidnullable -
statisticsobject4 properties
-
teamsintegerat least 0
-
matchesintegerat least 0
-
scheduledintegerat least 0
-
finishedintegerat least 0
-
-
publishedAtstring · date-timenullable -
archivedAtstring · date-timenullable -
divisionsobject[]4 properties
-
idstringexactly 10 characters
-
namestring1–40 characters
-
shortNamestring1–8 characters
-
colorstring
-
-
cancelationobjectnullable2 properties
-
canceledAtstring · date-time -
reasonstringat most 240 characters
-
-
{
"count": 0,
"tournaments": [
{
"_id": "000000000000000000000001",
"mandate": "000000000000000000000001",
"shortId": "string",
"name": "string",
"description": "string",
"image": {
"resource": "string"
},
"color": "",
"tags": [
"string"
],
"place": {
"type": "resource"
},
"timezone": "string",
"days": [
{
"date": "string",
"start": {
"hours": 0,
"minutes": 0
}
}
],
"period": {
"from": "2026-06-15T22:30:00Z",
"to": "2026-06-15T22:30:00Z"
},
"participantType": "team",
"event": "000000000000000000000001",
"statistics": {
"teams": 0,
"matches": 0,
"scheduled": 0,
"finished": 0
},
"publishedAt": "2026-06-15T22:30:00Z",
"archivedAt": "2026-06-15T22:30:00Z",
"divisions": [
{
"id": "string",
"name": "string",
"shortName": "string",
"color": ""
}
],
"cancelation": {
"canceledAt": "2026-06-15T22:30:00Z",
"reason": "string"
}
}
]
}
Errors
No errors of its own are known for this endpoint.
Errors nearly every request can meet are listed under Errors.