> ## Documentation Index
> Fetch the complete documentation index at: https://docs.masterskills.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync

> POST /sync — report installed state, receive the pending-change diff.

## `POST /sync`

One round-trip powers `masterskills update --check`: the device reports what it has installed and receives everything that drifted.

```json theme={"dark"}
// request
{
  "installed": [
    { "name": "@acme/api-conventions", "version": 3 },
    { "name": "@acme/legacy-deploy", "version": 1 }
  ]
}

// 200
{
  "updates":     [{ "name": "@acme/api-conventions", "from": 3, "to": 4 }],
  "newRequired": [{ "name": "@acme/security-guidelines", "version": 2 }],
  "removed":     [{ "name": "@acme/legacy-deploy" }]
}
```

| Field         | Meaning                                               |
| ------------- | ----------------------------------------------------- |
| `updates`     | Installed skills with a newer version in the registry |
| `newRequired` | Org-required skills this device doesn't have          |
| `removed`     | Skills archived (or unknown), still installed locally |

Side effects: the report reconciles the server's install records — which feeds the panel's install counts — and refreshes the device's `lastSeenAt`.

The registry never pushes; state converges only when a device calls this endpoint, and clients apply the diff **only with user consent**.
