---
title: "POST /api/users/{user}:importMemos"
method: POST
path: "/api/users/{user}:importMemos"
tags: ["UserService"]
---

# POST /api/users/{user}:importMemos

`POST /api/users/{user}:importMemos`

## Request

- The document declares no server URL.
- Auth: none declared

ImportMemos uploads a Memos export file in bounded chunks and imports it
 into the user's memos. The first call carries the spec and returns an
 upload_id; later calls carry that upload_id. A finishing call with
 validate_only returns the plan and keeps the archive staged; a finishing
 call without it imports and returns the report. Uploads are bound to the
 authenticated user, expire after 30 minutes of inactivity, and do not
 survive a server restart.

## Path parameters

- `user` string, required

## Request body

- ImportMemosRequest: Request message for UserService.ImportMemos.
  - `name` string, required: Required. The user who receives the memos. Must be the caller. Format: users/{user}
  - `spec` ImportMemosSpec: ImportMemosSpec describes a new memo import upload.
    - `totalSize` string: Optional. Total size of the archive in bytes.
  - `uploadId` string: Continues the upload identified by a previous response.
  - `writeOffset` string, required: Required. Zero-based byte offset at which data is written. Must equal the committed size, except when retrying the most recently accepted chunk with identical bytes and offset, which is accepted without writing again.
  - `data` string, bytes: Optional. Archive bytes, at most max_chunk_size long. With no data and finish_write false, the call reports progress without writing, and write_offset is ignored.
  - `finishWrite` boolean: Optional. Finish the upload after writing data. The committed size must then equal total_size. The archive is validated and, unless validate_only is set, imported. Any later call for an imported upload returns the same report.
  - `conflictPolicy` 'CONFLICT_POLICY_UNSPECIFIED' | 'SKIP' | 'REPLACE' | 'DUPLICATE', enum: Optional. Read on the finishing call that imports. Unspecified means SKIP.
  - `validateOnly` boolean: Optional. On a finishing call, validate the archive and return the plan without importing. The upload stays staged so a later finishing call can import it.

## Response `200`

OK

- ImportMemosResponse: Response message for UserService.ImportMemos.
  - `uploadId` string: Opaque ID for subsequent calls. This is not a resource name.
  - `committedSize` string: Number of archive bytes committed so far.
  - `maxChunkSize` integer: Maximum number of data bytes accepted in one call.
  - `plan` ImportMemosPlan: ImportMemosPlan describes what importing a staged archive would do.
    - `exportTime` string, date-time: When the archive was written.
    - `exporter` string: Username of the user who exported the archive.
    - `generator` string: The software that wrote the archive.
    - `memoCount` integer: Number of memo records in the archive.
    - `attachmentCount` integer: Number of attachment files in the archive.
    - `new` integer: Memos whose UID nobody on the instance holds.
    - `existing` integer: Memos the user already holds; the conflict policy applies to them.
    - `renamed` integer: Memos whose UID another account holds; they are imported under fresh UIDs.
    - `warnings` ImportMemosIssue[]: Deviations the archive reader corrected while validating.
      - `memoUid` string: The archive memo UID the issue concerns, if any.
      - `message` string: A description of the issue.
  - `report` ImportMemosReport: ImportMemosReport is the outcome of an import.
    - `created` integer: Number of memos created.
    - `updated` integer: Number of existing memos replaced under the REPLACE policy.
    - `skipped` integer: Number of existing memos left untouched under the SKIP policy.
    - `failed` integer: Number of memos that could not be imported.
    - `warnings` ImportMemosIssue[]: Deviations the importer corrected or tolerated.
      - `memoUid` string: The archive memo UID the issue concerns, if any.
      - `message` string: A description of the issue.
    - `failures` ImportMemosIssue[]: One entry per failed memo, with the reason.
      - `memoUid` string: The archive memo UID the issue concerns, if any.
      - `message` string: A description of the issue.

## Other responses

- `default`: Default error response

## Changes

- **2026-10-08** `1846a777b0ef`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/usememos/apis/untitled-api/changes/api/users/:user:importMemos/post.md)

---

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