# Delete an attachment and its stored file

Authenticated and org-scoped, unlike the GET above: holding the link must not be enough to destroy the file. Removes the object from storage inline, because presigned URLs already issued stay valid for their full 60 seconds and only the object going away revokes them.

Reach follows the parent — the attachment's issue, or its comment's issue — so an attachment outside the caller's workspace answers 404, never 403. So does one already deleted, which makes a repeated delete idempotent, and one whose parent is already gone: there is no workspace left to authorize it, and a background sweeper reclaims those.

200 even when storage refuses the delete: the attachment has left every view the caller can see, and the row stays marked so the sweeper finishes the file. 501 when storage is not configured, since marking the row would hide the only record of a file that could never be removed.

Canonical: https://easerix.com/docs/developers/api/tasks/attachments/deleteAttachment

{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}

export default function Layout(props) {
  const { APIPage, OpenAPIPage } = props.components ?? {};
  // "APIPage" is the old name from v10, this allows both for backward compatibility
  const Comp = OpenAPIPage ?? APIPage;
  return (
    <>
      {props.children}
      <Comp document="tasks" operations={[{"path":"/v1/attachments/{id}","method":"delete"}]} />
    </>
  );
}
