Reconcile a batch of local skills with the platform
One endpoint, two consumers:
- SDK auto-discovery (CI, agent boot): defaults are right.
Send
{"skills": [...]}and readcreated/updated/unchangedcounts. - Interactive CLI (
decimalai skills sync ./skills/): passresponse_mode="diff"to get a per-skillactionsarray includingbody_markdownfor any skill where the remote version is newer (so the CLI can overwrite local files).
Conflict policy: with conflict_policy="newer_wins" (default), the
side whose timestamp is later wins — best for human-in-the-loop CLI.
For CI/SDK pipelines where the repo is the source of truth, pass
conflict_policy="local_wins" to force every push. remote_wins is
the inverse — useful for “treat the platform as canonical.”
Empty bodies are 422’d at Pydantic validation. Invalid names are
409’d at the same layer. Per-skill issues that survive validation
(e.g. a transient DB error) land in the failures array; the rest
of the batch still processes.
content_hash on each entry is optional — clients that already
computed SHA-256 (CLI walking a directory) can pass it to save a
server-side hash; clients that didn’t (SDK auto-discovery) can omit.
Authorizations
Enter your API key (e.g. dai_sk_test_key_001)
Cookies
Body
Validated request for POST /skills/sync.
Single endpoint covers both CLI (bidirectional reconciliation) and SDK
(one-way upsert) — the difference is the response_mode flag (rich
actions array for CLI, summary counts for SDK) and the conflict_policy
(CLI defaults to newer_wins for human-in-the-loop, CI/SDK should set
local_wins because the repo is the source of truth).
1 - 200 elementsAuthor display name recorded on every SkillVersion created by this sync.
Project-local install identity (persisted by the SDK in .decimal/install.json). When present, the sync records per-install divergence state so GET /skills/installs can flag local/remote drift. Omit for back-compat: the sync then behaves exactly as before.
128Human-friendly install label (hostname, 'ci', …) for the dashboard.
200newer_wins: compare timestamps (default; right for interactive CLI). local_wins: always overwrite remote (right for CI / build artifacts). remote_wins: never overwrite local; conflicts return pulled actions.
newer_wins, local_wins, remote_wins summary: return counts only (cheap; SDK default). diff: return per-skill actions array including bodies for pulled skills (CLI).
summary, diff Response
Successful Response
"ok"Number of new skills created.
Number of existing skills with a new version (pushed).
Number of skills whose body hash matched — no-op.
Number of skills where remote was newer; caller should refresh local.
Per-skill failures with name + error.
Per-skill action list — present only when response_mode='diff'.