# Event sync ## `GET /api/guilds/{guild_id}/event-sync` **List pending Discord event syncs** Returns every event push and tombstone the bot should apply to Discord now. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | **Response `200` — The pending pushes and tombstones.** Model: {ref}`DiscordSyncPending ` | Field | Type | Required | Description | |---|---|---|---| | `pushes` | array of {ref}`DiscordEventPush ` | yes | | | `deletions` | array of integer | yes | Discord event ids whose guild event was deleted on the site. | | `activity` | array of {ref}`SignupActivity ` | no | Unposted sign-up activity for events with a Discord thread, oldest first. | ## `POST /api/guilds/{guild_id}/event-sync/activity/ack` **Acknowledge posted sign-up activity** Confirms the bot posted these sign-up activity rows in their event's forum thread. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | **Request body** Model: {ref}`ActivityAck ` | Field | Type | Required | Description | |---|---|---|---| | `ids` | array of string (uuid) | yes | | **Response `204`** — The activity rows were acknowledged. ## `POST /api/guilds/{guild_id}/event-sync/events` **Report a Discord scheduled event** Reports that one Discord scheduled event was created or updated. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | **Request body** Model: {ref}`DiscordEventState ` | Field | Type | Required | Description | |---|---|---|---| | `id` | integer | yes | | | `name` | string | yes | | | `description` | string \| null | no | | | `starts_at` | string (date-time) | yes | | | `ends_at` | string (date-time) \| null | no | | | `status` | {ref}`DiscordEventStatus ` | yes | | | `location` | string \| null | no | External events only. | | `channel_id` | integer \| null | no | Voice/stage events only. | **Response `204`** — The event state was applied. ## `DELETE /api/guilds/{guild_id}/event-sync/events/{event_id}` **Report a deleted Discord scheduled event** Reports that a Discord scheduled event was deleted. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | | `event_id` | path | integer | yes | The Discord scheduled event's ID. | **Response `204`** — The deletion was recorded. ## `PUT /api/guilds/{guild_id}/event-sync/interest/{discord_event_id}` **Report Discord event interest** Replaces the interested-user set for the guild event linked to a Discord scheduled event. Does nothing if no guild event is linked. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | | `discord_event_id` | path | integer | yes | The Discord scheduled event's ID. | **Request body** Model: {ref}`DiscordInterestReport ` | Field | Type | Required | Description | |---|---|---|---| | `user_ids` | array of integer | yes | | **Response `204`** — The interest list was replaced. ## `POST /api/guilds/{guild_id}/event-sync/reconcile` **Reconcile Discord scheduled events** Reconciles deletions and stale tombstones against every scheduled event currently in the guild. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | **Request body** Model: {ref}`DiscordEventReconcile ` | Field | Type | Required | Description | |---|---|---|---| | `events` | array of {ref}`DiscordEventState ` | yes | | **Response `204`** — The reconciliation ran. ## `DELETE /api/guilds/{guild_id}/event-sync/tombstones/{event_id}` **Clear an event sync tombstone** Drops the tombstone after the bot deleted this event in Discord. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | | `event_id` | path | integer | yes | The Discord scheduled event's ID. | **Response `204`** — The tombstone was cleared. ## `POST /api/guilds/{guild_id}/event-sync/{event_id}/ack` **Acknowledge an event sync push** Confirms the bot applied the given push hash to this event's Discord event. Returns 404 for any guild_id other than the SideQuest server. **Parameters** | Name | In | Type | Required | Description | |---|---|---|---|---| | `guild_id` | path | integer | yes | The Discord server ID. Only the SideQuest server works. | | `event_id` | path | string (uuid) | yes | The site event's ID. | **Request body** Model: {ref}`DiscordPushAck ` | Field | Type | Required | Description | |---|---|---|---| | `push_hash` | string | yes | | | `event` | {ref}`DiscordEventState ` \| null | yes | | | `thread_id` | integer \| null | no | | **Response `204`** — The push was acknowledged.