Skip to main content

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

POST/api/admin/sync/full

Queues 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

StatusDescriptionBody
202Sync queued.any
400Invalid request body.
401Authentication required.
403System Admin access required.
404Server not found.
409Sync already queued or in progress.

Open in Swagger (opens in a new tab)

Get paginated sync logs for a server

GET/api/admin/sync/logs

Returns a paginated list of all sync operations run against a specific server.

Authentication: Admin session token (Authorization: Bearer <token>)

Parameters

NameInTypeRequiredDescription
serverIdquerystringyesDiscord server (guild) ID
limitquerynumbernoMax results to return (1-100) Default: 20.
offsetquerynumbernoNumber of records to skip Default: 0.

Responses

StatusDescriptionBody
200Sync logs retrieved successfully.SyncLogsResponseDto
400Invalid serverId, limit, or offset.
401Authentication required.
403System Admin access required.

Open in Swagger (opens in a new tab)

Get granular change details for a specific sync log

GET/api/admin/sync/logs/{syncLogId}/changes

Returns 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

NameInTypeRequiredDescription
syncLogIdpathnumberyes
limitquerynumberno
offsetquerynumberno

Responses

StatusDescriptionBody
200Sync change details retrieved successfully.SyncChangeDetailsResponseDto
400Invalid syncLogId, limit, or offset.
401Authentication required.
403System Admin access required.
404Sync log not found.

Open in Swagger (opens in a new tab)

Get the latest sync status for a specific server

GET/api/admin/sync/status

Authentication: Admin session token (Authorization: Bearer <token>)

Parameters

NameInTypeRequiredDescription
serverIdquerystringyes

Responses

StatusDescriptionBody
200Sync status retrieved successfully.SyncStatusDto
400Invalid serverId format.
401Authentication required.
403System Admin access required.
404No sync logs found for this server.

Open in Swagger (opens in a new tab)

Get latest sync status for all active servers

GET/api/admin/sync/status/all

Returns the most recent sync result for every active server managed by MCDI.

Authentication: Admin session token (Authorization: Bearer <token>)

Responses

StatusDescriptionBody
200All server sync statuses retrieved.array of SyncStatusDto
400Invalid parameter.
401Authentication required.
403System Admin access required.

Open in Swagger (opens in a new tab)

Schemas

SyncChangeDetailDto schema

FieldTypeRequiredDescription
action"added" or "removed" or "updated" or "deactivated" or "role_assigned" or "role_removed"yes
createdAtstringyes
descriptionstringno
detailsstringno
entityIdstringyes
entityType"member" or "role" or "server"yes
idnumberyes
serverIdstringyes
syncLogIdnumberyes

SyncChangeDetailsResponseDto schema

FieldTypeRequiredDescription
changesarray of SyncChangeDetailDtoyes
totalnumberyes

SyncLogDto schema

FieldTypeRequiredDescription
finishedAtstringno
idnumberyes
membersSyncednumberyes
messagestringno
rolesSyncednumberyes
serverIdstringyes
startedAtstringyes
status"queued" or "in_progress" or "success" or "failed"yes
syncType"full" or "incremental" or "manual"yes

SyncLogsResponseDto schema

FieldTypeRequiredDescription
logsarray of SyncLogDtoyes
totalnumberyes

SyncStatusDto schema

FieldTypeRequiredDescription
finishedAtstringno
lastSyncAtstring or nullyes
membersSyncednumberyes
messagestringno
rolesSyncednumberyes
serverIdstringyes
startedAtstringyes
status"queued" or "in_progress" or "success" or "failed" or "never"yes

TriggerSyncDto schema

FieldTypeRequiredDescription
serverIdsarray of array of stringyes
target"all" or "members" or "roles"noWhat entities to sync Default: "all".

Source: apps/api/openapi.json.