Skip to content

Web Server API

The Rondo Sync web server (Fastify on port 3000) exposes a programmatic API for triggering syncs from external systems like Rondo Club.

API endpoints use a shared API key, separate from the dashboard session auth.

Header: X-Sync-API-Key: {key}

The key is set via the SYNC_API_KEY environment variable on the sync server. Generate one with:

Terminal window
openssl rand -base64 32
ScenarioStatusResponse
Missing header401{ ok: false, error: "Missing X-Sync-API-Key header" }
Invalid key403{ ok: false, error: "Invalid API key" }
Key not configured on server503{ ok: false, error: "API key not configured on server" }

Syncs a single member from Sportlink to Rondo Club. Launches a Playwright browser session to fetch fresh data from Sportlink (functions, committees, free fields), then syncs the member to WordPress.

Rate limit: 5 requests per minute.

Concurrency: Only one individual sync can run at a time (Sportlink uses TOTP, so only one Playwright session is possible).

{
"knvb_id": "12345678"
}
FieldTypeRequiredDescription
knvb_idstringYesKNVB member ID (4-10 alphanumeric characters, e.g. TJJS83T)

Success (200)

{
"ok": true,
"knvb_id": "12345678",
"action": "updated",
"rondo_club_id": 456
}
action valueMeaning
createdNew person created in Rondo Club
updatedExisting person updated
skippedNo changes detected (member already up to date)

Errors

StatusConditionResponse
400Invalid or missing knvb_id{ ok: false, error: "Invalid knvb_id: must be 4-10 alphanumeric characters" }
422Member not found in Sportlink data{ ok: false, error: "Member not found" }
429Another sync already running{ ok: false, error: "Another individual sync is already in progress. Try again in a minute." }
500Internal error{ ok: false, error: "Internal sync error" }
Terminal window
curl -X POST https://sync.example.com/api/sync/individual \
-H 'Content-Type: application/json' \
-H 'X-Sync-API-Key: your-api-key-here' \
-d '{"knvb_id":"12345678"}'

Add to the sync server’s .env:

Terminal window
SYNC_API_KEY=your-generated-key-here

After adding the key, restart the web server:

Terminal window
systemctl restart rondo-sync-web

The same key must be configured in Rondo Club’s .env so WordPress can call this endpoint.