POST
/api/v1/attachmentsCreate an attachment
Creates a new attachment. Supply the required filename and type, and optionally associate the attachment with a memo using memo. Set attachmentId to choose an ID, or omit it to have one generated.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
attachmentIdstringoptional
ID to assign to the attachment. Must match `^[a-zA-Z0-9]([a-zA-Z0-9-]{0,34}[a-zA-Z0-9])?$`; a unique ID is generated when omitted.
Attachment details to create. filename and type are required.
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 created attachment, including its name, filename, type, and any supplied 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
filename and type are required in the request body. The attachmentId query parameter must match the documented format: begin and end with an alphanumeric character, with up to 35 alphanumeric characters or hyphens between them.
