PATCH
/api/v1/attachments/{attachment}Update an attachment
Updates an attachment identified by its resource name. Supply the attachment fields and use updateMask to specify which fields to update. The request body schema requires filename and type.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
attachmentstringrequired
The identifier of the attachment to update.
updateMaskstringoptional
Field mask identifying the fields to update.
Attachment fields for the update. filename and type are required by the request body schema.
namestringoptional
The name of the attachment.
Format: attachments/{attachment}
createTimestringoptional
Output only. The creation timestamp.
filenamestringrequired
The filename of the attachment.
contentstringoptional
Input only. The content of the attachment.
externalLinkstringoptional
Optional. The external link of the attachment.
typestringrequired
The MIME type of the attachment.
sizestringoptional
Output only. The size of the attachment in bytes.
memostringoptional
Optional. The related memo. Refer to `Memo.name`.
Format: memos/{memo}
motionMediaobjectoptional
Optional. Motion media metadata.
mediaMetadataobjectoptional
Optional. Immutable normalized media metadata explicitly supplied by the client at creation time.
creatorstringoptional
Output only. The user who uploaded this attachment, which may differ from
the creator of the linked memo. Format: users/{user}.
200Returns the updated attachment, including its name, filename, type, and available metadata.
namestringoptional
The name of the attachment.
Format: attachments/{attachment}
createTimestringoptional
Output only. The creation timestamp.
filenamestringrequired
The filename of the attachment.
contentstringoptional
Input only. The content of the attachment.
externalLinkstringoptional
Optional. The external link of the attachment.
typestringrequired
The MIME type of the attachment.
sizestringoptional
Output only. The size of the attachment in bytes.
memostringoptional
Optional. The related memo. Refer to `Memo.name`.
Format: memos/{memo}
motionMediaobjectoptional
Optional. Motion media metadata.
mediaMetadataobjectoptional
Optional. Immutable normalized media metadata explicitly supplied by the client at creation time.
creatorstringoptional
Output only. The user who uploaded this attachment, which may differ from
the creator of the linked memo. Format: users/{user}.
defaultReturned when the request fails; includes an error code, a developer-facing message, and optional structured 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
The attachment path parameter must identify the attachment to update. The updateMask query parameter uses the field-mask format to identify the fields being updated. The request body requires filename and type.
