---
title: "Sync Community Rooms"
method: POST
path: "/events/community-rooms/sync"
tags: ["events"]
---

# Sync Community Rooms

`POST /events/community-rooms/sync`

Cron-triggered endpoint that ensures the right number of voice chatrooms exist
for each community hour that's currently active or about to start.

Logic per event:
  1. Skip if we're not within the [start - lead, start + duration] window.
  2. Count confirmed RSVPs for the upcoming/current occurrence.
  3. Compute desired room count: max(1, ceil(rsvp_count / TARGET_PER_ROOM)).
  4. Count existing chatrooms already auto-created for this occurrence
     (matched by activity_config.community_event_id).
  5. Create the difference, all with activity_type=canasta and the right language.

Idempotent — safe to call repeatedly. Uses activity_config.community_event_id
as the dedup key so we don't double-spawn within a single occurrence.

## Response `200`

Successful Response

- unknown

---

[API](https://skmtc.dev/fluentea/apis/aurqa-language-learning-platform-refactored.md) · [All operations](https://skmtc.dev/fluentea/apis/aurqa-language-learning-platform-refactored/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fluentea/aurqa-language-learning-platform-refactored/revisions/78f314acd8bf/schema)
