Update an attachment ​
Updates an existing attachment by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Path Parameters ​
workspace_slug:requiredstringThe workspace_slug represents the unique workspace identifier for a workspace in Plane. It can be found in the URL. For example, in the URL https://app.plane.so/my-team/projects/, the workspace slug is my-team.
project_id:requiredstringThe unique identifier of the project.
work_item_id:requiredstringThe unique identifier of the work item.
attachment_id:requiredstringThe unique identifier of the attachment.
Body Parameters ​
attributes:optionalobjectFile metadata object containing name, size, and type.
asset:optionalstringStorage path/identifier for the attachment file.
entity_type:optionalstringEntity type of the attachment.
entity_identifier:optionalstringEntity identifier for the attachment.
is_deleted:optionalbooleanWhether the attachment has been deleted.
is_archived:optionalbooleanWhether the attachment has been archived.
external_id:optionalstringExternal identifier if the attachment is imported to Plane.
external_source:optionalstringName of the source if the attachment is imported to Plane.
size:optionalnumberFile size in bytes.
is_uploaded:optionalbooleanWhether the file has been successfully uploaded.
storage_metadata:optionalobjectCloud storage metadata.
curl -X PATCH \
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/project-uuid/work-items/work-item-uuid/attachments/{attachment_id}/" \
-H "X-API-Key: $PLANE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"attributes": "example-attributes",
"asset": "example-asset",
"entity_type": "example-entity_type",
"entity_identifier": "example-entity_identifier",
"is_deleted": true,
"is_archived": true,
"external_id": "example-external_id",
"external_source": "example-external_source",
"size": 1,
"is_uploaded": true,
"storage_metadata": "example-storage_metadata"
}'import requests
response = requests.patch(
"https://api.plane.so/api/v1/workspaces/my-workspace/projects/project-uuid/work-items/work-item-uuid/attachments/{attachment_id}/",
headers={"X-API-Key": "your-api-key"},
json={
'attributes': 'example-attributes',
'asset': 'example-asset',
'entity_type': 'example-entity_type',
'entity_identifier': 'example-entity_identifier',
'is_deleted': true,
'is_archived': true,
'external_id': 'example-external_id',
'external_source': 'example-external_source',
'size': 1,
'is_uploaded': true,
'storage_metadata': 'example-storage_metadata'
}
)
print(response.json())const response = await fetch(
'https://api.plane.so/api/v1/workspaces/my-workspace/projects/project-uuid/work-items/work-item-uuid/attachments/{attachment_id}/',
{
method: 'PATCH',
headers: {
'X-API-Key': 'your-api-key',
'Content-Type': 'application/json',
},
body: JSON.stringify({
attributes: 'example-attributes',
asset: 'example-asset',
entity_type: 'example-entity_type',
entity_identifier: 'example-entity_identifier',
is_deleted: true,
is_archived: true,
external_id: 'example-external_id',
external_source: 'example-external_source',
size: 1,
is_uploaded: true,
storage_metadata: 'example-storage_metadata',
}),
},
);
const data = await response.json();{
"id": "project-uuid",
"name": "Project Name",
"identifier": "PROJ",
"description": "Project description",
"created_at": "2024-01-01T00:00:00Z"
}
