Delete a workspace page attachment
DELETE/api/v2/workspaces/{slug}/pages/{page_id}/attachments/{pk}/
Delete an attachment from a wiki page. A successful delete returns 204 with an empty body. After that, every read of the attachment, including its download, returns 404.
The delete works on confirmed and unconfirmed attachments alike, so you can also use it to clean up an upload you started and didn't finish. It doesn't edit the page body. If description_html still references the file, that reference stays.
The page must be active and unlocked, and you need edit access to it. See Locked and archived pages.
Path Parameters
slug:requiredstringThe workspace slug. It appears in your Plane URLs. In https://app.plane.so/my-team/projects/, the slug is my-team.
page_id:requiredstring (uuid)The wiki page the attachment belongs to.
pk:requiredstring (uuid)The id of the attachment to delete.
Scopes
wiki.pages:write
Errors
| Status | Code | Cause |
|---|---|---|
400 | invalid_request | The page is locked or archived. |
401 | unauthorized | Missing or invalid credentials. |
402 | payment_required | The feature this endpoint belongs to isn't enabled on your plan, or is switched off. |
403 | forbidden | Your role or token scope can't edit this page, or the page is private and you lack Edit access to it. |
404 | not_found | No such wiki page or attachment, the attachment is on another page, or it was already deleted. |
406 | not_acceptable | The Accept header asks for a representation the API can't produce. |
409 | conflict | All write endpoints declare this status. This endpoint has no conflict case of its own. |
413 | payload_too_large | The request body is over the size limit. |
415 | unsupported_media_type | The Content-Type isn't one this endpoint accepts. |
429 | rate_limited | Throttled. Honor the Retry-After header before retrying. |
Delete a workspace page attachment
bash
curl -X DELETE \
"https://api.plane.so/api/v2/workspaces/my-team/pages/9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88/attachments/8f4c2b1e-0d3a-4f7b-9c21-6e5a8b7d4f13/" \
-H "X-Api-Key: $PLANE_API_KEY"python
import requests
response = requests.delete(
"https://api.plane.so/api/v2/workspaces/my-team/pages/9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88"
"/attachments/8f4c2b1e-0d3a-4f7b-9c21-6e5a8b7d4f13/",
headers={"X-Api-Key": "your-api-key"},
)
print(response.status_code)javascript
const response = await fetch(
"https://api.plane.so/api/v2/workspaces/my-team/pages/9c1f0b3d-6d2e-4c9a-8b41-2f7e5a0d6c88" +
"/attachments/8f4c2b1e-0d3a-4f7b-9c21-6e5a8b7d4f13/",
{
method: "DELETE",
headers: {
"X-Api-Key": "your-api-key",
},
},
);
console.log(response.status);Response204
No response body.
Response400
json
{
"type": "invalid_request",
"code": "invalid_request",
"detail": "Page is locked."
}
