DocumentationAPI reference
Rust · 0.1.0
Attachment
File metadata; content is upload-only and normal reads return metadata.
Creation versus existing references
CreateAttachment accepts base64 content. Chunk upload keeps metadata in spec.attachment and sends bytes in data. When an existing attachment is listed in a memo's desired attachment set, name identifies it; filename/type requirements in this shared schema do not mean the bytes must be uploaded again. UpdateAttachment changes filename only, and mediaMetadata is immutable after creation.
Where this schema is used
These links are derived from direct references in the protocol snapshot. Follow the calling operation for authentication, accepted fields and runtime behavior; a reusable resource schema is not by itself a complete write request.
- POSTCreate Attachment
/api/v1/attachments - GETGet Attachment
/api/v1/attachments/{attachment} - PATCHUpdate Attachment
/api/v1/attachments/{attachment}
Referenced by these component schemas:
Shape and fields
object
| Field | Type / requirement | Description |
|---|---|---|
name | string | The name of the attachment. Format: attachments/{attachment} |
createTime | string (date-time) | Output only. The creation timestamp. |
filename | string Required | The filename of the attachment. |
content | string (bytes) | Input only. The content of the attachment. |
externalLink | string | Optional. The external link of the attachment. |
type | string Required | The MIME type of the attachment. |
size | string | Output only. The size of the attachment in bytes. |
memo | string | Optional. The related memo. Refer to `Memo.name`. Format: memos/{memo} |
motionMedia | allOf MotionMedia | Optional. Motion media metadata. |
mediaMetadata | allOf MediaMetadata | Optional. Immutable normalized media metadata explicitly supplied by the client at creation time. |
Complete schema
Use this complete JSON definition for constraints and nested structure. A field's presence here does not mean it is writable by every caller.
{
"required": [
"filename",
"type"
],
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "The name of the attachment.\n Format: attachments/{attachment}"
},
"createTime": {
"readOnly": true,
"type": "string",
"description": "Output only. The creation timestamp.",
"format": "date-time"
},
"filename": {
"type": "string",
"description": "The filename of the attachment."
},
"content": {
"writeOnly": true,
"type": "string",
"description": "Input only. The content of the attachment.",
"format": "bytes"
},
"externalLink": {
"type": "string",
"description": "Optional. The external link of the attachment."
},
"type": {
"type": "string",
"description": "The MIME type of the attachment."
},
"size": {
"readOnly": true,
"type": "string",
"description": "Output only. The size of the attachment in bytes."
},
"memo": {
"type": "string",
"description": "Optional. The related memo. Refer to `Memo.name`.\n Format: memos/{memo}"
},
"motionMedia": {
"allOf": [
{
"$ref": "#/components/schemas/MotionMedia"
}
],
"description": "Optional. Motion media metadata."
},
"mediaMetadata": {
"allOf": [
{
"$ref": "#/components/schemas/MediaMetadata"
}
],
"description": "Optional. Immutable normalized media metadata explicitly supplied by the client at creation time."
}
}
}