Sync
Trigger a full sync of a server, follow its status and read the logs and change details of past syncs.
Manual sync triggering and sync log inspection - system admin only
Trigger a full sync
/api/admin/sync/fullQueues a manual sync for one or more servers. Use target to limit the sync to MEMBERS, ROLES, or ALL (default). Omit serverIds to sync all active servers.
Authentication: Admin session token (Authorization: Bearer <token>)
Request body (JSON, required): TriggerSyncDto schema.
Responses
| Status | Description | Body |
|---|---|---|
202 | Sync queued. | any |
400 | Invalid request body. | |
401 | Authentication required. | |
403 | System Admin access required. | |
404 | Server not found. | |
409 | Sync already queued or in progress. |
Open in Swagger (opens in a new tab)
Get paginated sync logs for a server
/api/admin/sync/logsReturns a paginated list of all sync operations run against a specific server.
Authentication: Admin session token (Authorization: Bearer <token>)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | query | string | yes | Discord server (guild) ID |
limit | query | number | no | Max results to return (1-100) Default: 20. |
offset | query | number | no | Number of records to skip Default: 0. |
Responses
| Status | Description | Body |
|---|---|---|
200 | Sync logs retrieved successfully. | SyncLogsResponseDto |
400 | Invalid serverId, limit, or offset. | |
401 | Authentication required. | |
403 | System Admin access required. |
Open in Swagger (opens in a new tab)
Get granular change details for a specific sync log
/api/admin/sync/logs/{syncLogId}/changesReturns a paginated list of individual entity-level changes (member added/removed, role updated, etc.) recorded during a sync operation.
Authentication: Admin session token (Authorization: Bearer <token>)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
syncLogId | path | number | yes | |
limit | query | number | no | |
offset | query | number | no |
Responses
| Status | Description | Body |
|---|---|---|
200 | Sync change details retrieved successfully. | SyncChangeDetailsResponseDto |
400 | Invalid syncLogId, limit, or offset. | |
401 | Authentication required. | |
403 | System Admin access required. | |
404 | Sync log not found. |
Open in Swagger (opens in a new tab)
Get the latest sync status for a specific server
/api/admin/sync/statusAuthentication: Admin session token (Authorization: Bearer <token>)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | query | string | yes |
Responses
| Status | Description | Body |
|---|---|---|
200 | Sync status retrieved successfully. | SyncStatusDto |
400 | Invalid serverId format. | |
401 | Authentication required. | |
403 | System Admin access required. | |
404 | No sync logs found for this server. |
Open in Swagger (opens in a new tab)
Get latest sync status for all active servers
/api/admin/sync/status/allReturns the most recent sync result for every active server managed by MCDI.
Authentication: Admin session token (Authorization: Bearer <token>)
Responses
| Status | Description | Body |
|---|---|---|
200 | All server sync statuses retrieved. | array of SyncStatusDto |
400 | Invalid parameter. | |
401 | Authentication required. | |
403 | System Admin access required. |
Open in Swagger (opens in a new tab)
Schemas
SyncChangeDetailDto schema
| Field | Type | Required | Description |
|---|---|---|---|
action | "added" or "removed" or "updated" or "deactivated" or "role_assigned" or "role_removed" | yes | |
createdAt | string | yes | |
description | string | no | |
details | string | no | |
entityId | string | yes | |
entityType | "member" or "role" or "server" | yes | |
id | number | yes | |
serverId | string | yes | |
syncLogId | number | yes |
SyncChangeDetailsResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
changes | array of SyncChangeDetailDto | yes | |
total | number | yes |
SyncLogDto schema
| Field | Type | Required | Description |
|---|---|---|---|
finishedAt | string | no | |
id | number | yes | |
membersSynced | number | yes | |
message | string | no | |
rolesSynced | number | yes | |
serverId | string | yes | |
startedAt | string | yes | |
status | "queued" or "in_progress" or "success" or "failed" | yes | |
syncType | "full" or "incremental" or "manual" | yes |
SyncLogsResponseDto schema
| Field | Type | Required | Description |
|---|---|---|---|
logs | array of SyncLogDto | yes | |
total | number | yes |
SyncStatusDto schema
| Field | Type | Required | Description |
|---|---|---|---|
finishedAt | string | no | |
lastSyncAt | string or null | yes | |
membersSynced | number | yes | |
message | string | no | |
rolesSynced | number | yes | |
serverId | string | yes | |
startedAt | string | yes | |
status | "queued" or "in_progress" or "success" or "failed" or "never" | yes |
TriggerSyncDto schema
| Field | Type | Required | Description |
|---|---|---|---|
serverIds | array of array of string | yes | |
target | "all" or "members" or "roles" | no | What entities to sync Default: "all". |
Source: apps/api/openapi.json.