AttachmentService · AttachmentService_UpdateAttachment
Access
Requires the attachment owner or an instance administrator. A linked attachment also requires permission to manage its memo and valid placement.
Only filename is mutable here
The implementation requires a nonempty updateMask but applies only filename. Other mask paths do not replace content, rebind memo, or edit media metadata. To change the bound set use the memo attachment operation; to replace file bytes create a new attachment. Use updateMask=filename and a body containing the new filename.
Request
UpdateAttachment updates an attachment.
/api/v1/attachments/{attachment}Parameters
| Name / location | Type / requirement | Description |
|---|---|---|
attachmentpath | string Required | The attachment id. |
updateMaskquery | string (field-mask) Required (contract description) | Required. The list of fields to update. |
Request body
Required
application/json · Attachment
Responses
200 · OK
application/json · Attachment
default · Default error response
application/json · Status
Complete operation definition
All declared constraints, media types and response details are retained below. Schema references link to their complete definitions.
Open JSON definition
{
"tags": [
"AttachmentService"
],
"description": "UpdateAttachment updates an attachment.",
"operationId": "AttachmentService_UpdateAttachment",
"parameters": [
{
"name": "attachment",
"in": "path",
"description": "The attachment id.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "updateMask",
"in": "query",
"description": "Required. The list of fields to update.",
"schema": {
"type": "string",
"format": "field-mask"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Attachment"
}
}
}
},
"default": {
"description": "Default error response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Status"
}
}
}
}
}
}