Booking · Events · Statistics
Get event attendance
Returns the events ending in a period and in the period of the same length right before it: how many there were, their attendees, canceled attendees and attendees on the waitlist, how full the events with a seat limit were and how many attendees of past events checked in. Also returns the attendees per month and the five events with the most attendees. Attendees are people who are confirmed or checked in. Canceled and blocked events are left 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.readevent.readattendee.read
Request
Path parameters
-
organizationIdidrequired -
mandateIdidrequired
Query parameters
-
fromDatestringrequired -
toDatestringrequired
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/statistics/attendance' \
--header 'X-API-Key: YOUR_API_KEY'const response = await fetch("https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/booking/events/statistics/attendance", {
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/statistics/attendance', 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
-
summaryobject12 properties
-
eventCountintegerat least 0
-
previousEventCountintegerat least 0
-
attendeeCountintegerat least 0
-
previousAttendeeCountintegerat least 0
-
utilizationRatenumbernullableat least 0
-
previousUtilizationRatenumbernullableat least 0
-
checkInRatenumbernullableat least 0
-
previousCheckInRatenumbernullableat least 0
-
canceledCountintegerat least 0
-
previousCanceledCountintegerat least 0
-
waitlistedCountintegerat least 0
-
previousWaitlistedCountintegerat least 0
-
-
monthsobject[]3 properties
-
datestring -
confirmedintegerat least 0
-
checkedInintegerat least 0
-
-
topEventsobject[]4 properties
-
_idid -
titlestring -
datestring · date-time -
attendeeCountintegerat least 0
-
{
"summary": {
"eventCount": 0,
"previousEventCount": 0,
"attendeeCount": 0,
"previousAttendeeCount": 0,
"utilizationRate": 0,
"previousUtilizationRate": 0,
"checkInRate": 0,
"previousCheckInRate": 0,
"canceledCount": 0,
"previousCanceledCount": 0,
"waitlistedCount": 0,
"previousWaitlistedCount": 0
},
"months": [
{
"date": "string",
"confirmed": 0,
"checkedIn": 0
}
],
"topEvents": [
{
"_id": "000000000000000000000001",
"title": "string",
"date": "2026-06-15T22:30:00Z",
"attendeeCount": 0
}
]
}
Errors
No errors of its own are known for this endpoint.
Errors nearly every request can meet are listed under Errors.