---
title: "Sync Lessons"
method: POST
path: "/datamates/{datamate_id}/lessons/sync"
tags: ["LEARNED_LESSONS"]
---

# Sync Lessons

`POST /datamates/{datamate_id}/lessons/sync`

## Request

- Base URL: `https://api.myaltimate.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.myaltimate.com/datamates/{datamate_id}/lessons/sync`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Session pull: the live lessons for this repo and store, plus tombstones
for the caller's ``local_keys``.

One REPEATABLE READ transaction, so the revision, the lessons and the
tombstones are one snapshot. With ``known_revision`` equal to the current
revision the lessons are omitted (``unchanged``), but tombstones are still
computed: a key restored locally by a checkout or rollback after the last
pull must still be suppressed.

## Path parameters

- `datamate_id` integer, required

## Request body

- SyncLessonsRequest
  - `repo_remote` string, required
  - `store` string
  - `known_revision` integer, nullable
  - `local_keys` string[]

## Response `200`

Successful Response

- SyncLessonsResponse
  - `unchanged` boolean, required
  - `revision` integer, required
  - `repo_identity` string, required
  - `share_lessons_across_repos` boolean, required
  - `pending_count` integer, required
  - `lessons` LessonOut[], required
    - `public_id` string, required
    - `lesson_key` string, required
    - `repo_identity` string, nullable
    - `store` string, required
    - `text` string, required
    - `tags` string[], required
    - `trigger_paths` string[], required
    - `pinned` boolean, required
    - `coexists` string[], required
    - `helpful` integer, required
    - `harmful` integer, required
    - `applied` integer, required
    - `version` integer, required
    - `updated_at` string, date-time, required
  - `tombstones` Tombstone[], required
    - `repo_identity` string, nullable
    - `store` string, required
    - `lesson_key` string, required

## Other responses

- `403`: Not the workspace's owner
- `404`: Workspace or lesson not found
- `409`: Changed since read, or refused
- `422`: Validation Error

## Changes

- **2026-10-14** `1b2d675195d7`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/myaltimate/apis/myaltimate-api/changes/datamates/:datamate_id/lessons/sync/post.md)

---

[API](https://skmtc.dev/myaltimate/apis/myaltimate-api.md) - [All operations](https://skmtc.dev/myaltimate/apis/myaltimate-api/llms.txt) - [OpenAPI document](https://skmtc.dev/myaltimate/apis/myaltimate-api/revisions/727657ce54e9?raw)
