Memos unofficial
POST/api/v1/users/{user}:importMemos

Import memos from an export archive

Imports a Memos export archive into a user's memos through bounded chunk uploads. Start with spec, then use the returned uploadId for subsequent chunks; a finishing call can validate the archive without importing it or import it and return a report. Uploads are bound to the authenticated user and expire after 30 minutes of inactivity.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 8 body fields
userstringrequired
The identifier of the user who receives the imported memos; it must match the authenticated user identified by the request body.

Chunked import request. Start an upload with spec, continue it with uploadId, and set finishWrite to finish writing and validate or import the archive.

namestringrequired
Required. The user who receives the memos. Must be the caller. Format: users/{user}
specobjectoptional
Starts a new upload. The same call may also carry data and finish_write.
uploadIdstringoptional
Continues the upload identified by a previous response.
writeOffsetstringrequired
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.
datastringoptional
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.
finishWritebooleanoptional
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.
validateOnlybooleanoptional
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.
conflictPolicystringoptional
Optional. Read on the finishing call that imports. Unspecified means SKIP.
Allowed:CONFLICT_POLICY_UNSPECIFIEDSKIPREPLACEDUPLICATE

2 status codes
200Returns the upload identifier, committed archive size, and maximum chunk size. A finishing validation call also returns an import plan; a finishing import call returns an import report.
uploadIdstringoptional
Opaque ID for subsequent calls. This is not a resource name.
committedSizestringoptional
Number of archive bytes committed so far.
maxChunkSizeintegeroptional
Maximum number of data bytes accepted in one call.
planobjectoptional
What the import would do. Set by a finishing call with validate_only.
reportobjectoptional
What the import did. Set by a finishing call that imported.
defaultReturned when the request fails. The response contains a status code, a developer-facing message, and optional error details.
codeintegeroptional
The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code].
messagestringoptional
A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client.
detailsarray<object>optional
A list of messages that carry the error details. There is a common set of message types for APIs to use.

Error handling

name and writeOffset are required. name must identify the authenticated user in the format users/{user}, and the user path parameter must identify that same user; writeOffset must equal the committed size unless retrying the most recently accepted chunk with identical bytes and offset. conflictPolicy accepts CONFLICT_POLICY_UNSPECIFIED, SKIP, REPLACE, or DUPLICATE; an unspecified value means SKIP.