---
title: "POST /v1/todos/sync"
method: POST
path: "/v1/todos/sync"
tags: ["TodoService"]
---

# POST /v1/todos/sync

`POST /v1/todos/sync`

SyncTodos opens a bidirectional stream for two-way synchronization.
 The client sends SyncTodoRequest messages describing local changes, and
 the server pushes back TodoEvent messages reflecting the resulting state.
 The stream stays open until either side closes it.

## Request body

- TodoV1SyncTodoRequest — SyncTodoRequest is a single client message in the SyncTodos bidirectional stream. The action field selects which operation to perform on the server.
  - `action` string — The operation to perform. One of `create`, `update`, or `delete`.
  - `todo` TodoV1Todo — Todo is the canonical representation of a todo item.
    - `id` string — Server-assigned unique identifier. Read-only on create.
    - `title` string — Short human-readable title.
    - `content` string — Detailed description or notes for the todo item.
    - `completed` boolean — Whether the todo item has been completed.
    - `createTime` string, date-time — Time at which the todo item was created. Server-assigned, read-only.
    - `updateTime` string, date-time — Time at which the todo item was last modified. Server-assigned, read-only.
  - `id` string — Identifier of the target todo. Required for `delete` and `update`.
  - `updateMask` string, field-mask — Field mask used by `update` actions to limit which fields are overwritten. Ignored for `create` and `delete`.

## Response `200`

OK

- TodoV1TodoEvent — TodoEvent is a server-sent message describing a change to a todo item. It is emitted by both WatchTodos and SyncTodos streams.
  - `action` string — The change that occurred. One of `created`, `updated`, or `deleted`.
  - `todo` TodoV1Todo — Todo is the canonical representation of a todo item.
    - `id` string — Server-assigned unique identifier. Read-only on create.
    - `title` string — Short human-readable title.
    - `content` string — Detailed description or notes for the todo item.
    - `completed` boolean — Whether the todo item has been completed.
    - `createTime` string, date-time — Time at which the todo item was created. Server-assigned, read-only.
    - `updateTime` string, date-time — Time at which the todo item was last modified. Server-assigned, read-only.
  - `eventTime` string, date-time — Time at which the change was observed by the server.

---

[API](https://skmtc.net/go-kratos/apis/todoservice-api.md) · [All operations](https://skmtc.net/go-kratos/apis/todoservice-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/go-kratos/todoservice-api/versions/d99daada47f9/schema)
