---
title: "Returns the cross-tenant reconciliation plan: every account that has any department row or any copilot_config row, with its departments (active AND passive) and per-brand Copilot desk selections."
method: GET
path: "/api/ai/kb-sync-plan"
tags: ["KbSyncPlan"]
---

# Returns the cross-tenant reconciliation plan: every account that has any department row or any copilot_config row, with its departments (active AND passive) and per-brand Copilot desk selections.

`GET /api/ai/kb-sync-plan`

## Response `200`

OK

- KbSyncPlanResponse — Response for `GET /api/ai/kb-sync-plan` — the cross-tenant reconciliation plan the helpdesk-updater pulls to decide which knowledge-base departments to keep, purge, or resync per account. Desk→department mapping is intentionally NOT here: it lives in the helpdesk service and the updater fetches it there. This endpoint is DB-only. Both serializer attributes are present on every field: Infoset.Api serializes with Newtonsoft.Json (AddNewtonsoftJson in Startup), so [JsonProperty] drives the wire shape, while [JsonPropertyName] keeps System.Text.Json consumers (ad-hoc test deserialisers) in sync. camelCase matches the sibling internal responses.
  - `accounts` KbSyncPlanAccount[], nullable
    - `accountId` integer
    - `departments` KbSyncPlanDepartment[], nullable
      - `id` integer
      - `status` string, nullable
    - `selections` KbSyncPlanSelection[], nullable
      - `departmentId` integer
      - `selectedDeskIds` string[], nullable

## Other responses

- `401` — Unauthorized

---

[API](https://skmtc.dev/infoset/apis/infoset-rest-api.md) · [All operations](https://skmtc.dev/infoset/apis/infoset-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/infoset/infoset-rest-api/revisions/f5bc39a1ac15/schema)
