> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # DeleteAttachment # Package: attachments # Namespace: ContactAttachmentsServiceV4 # Method link: https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/attachments/attachment-v4/delete-attachment.md ## Permission Scopes: Manage Contact Attachments: SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS ## Introduction Deletes the specified attachment from the specified contact. --- ## REST API ### Schema ``` Method: deleteAttachment Description: Deletes the specified attachment from the specified contact. URL: https://www.wixapis.com/contacts/v4/attachments/{contactId}/{attachmentId} Method: DELETE # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: contactId, attachmentId Method parameters: param name: attachmentId | type: none | required: true param name: contactId | type: none | required: true Return type: DeleteAttachmentResponse EMPTY-OBJECT {} ``` ### Examples ### DeleteAttachment ```curl ~~~cURL curl -X DELETE \ 'https://www.wixapis.com/contacts/v4/attachments/513c1bfc-61b6-427d-a7f8-ceeedb1eb763/1e7efe60-355a-11eb-b032-19d0ca8630af' \ -H 'Authorization: ' ~~~ ``` --- ## JavaScript SDK ### Schema ``` Method: wixClientAdmin.attachments.ContactAttachmentsServiceV4.deleteAttachment(identifiers) Description: Deletes the specified attachment from the specified contact. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: identifiers.contactId, identifiers.attachmentId, identifiers Method parameters: param name: identifiers | type: DeleteAttachmentIdentifiers none | required: true - name: contactId | type: string | description: Contact GUID for the attachment to delete. | required: true - name: attachmentId | type: string | description: Attachment GUID to delete. | required: true Return type: PROMISE EMPTY-OBJECT {} ``` ### Examples ### deleteAttachment ```javascript import { attachments } from '@wix/crm'; async function deleteAttachment(identifiers) { const response = await attachments.deleteAttachment(identifiers); }; ``` ### deleteAttachment (with elevated permissions) ```javascript import { attachments } from '@wix/crm'; import { auth } from '@wix/essentials'; async function myDeleteAttachmentMethod(identifiers) { const elevatedDeleteAttachment = auth.elevate(attachments.deleteAttachment); const response = await elevatedDeleteAttachment(identifiers); } ``` ### deleteAttachment (self-hosted) Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md). ```javascript import { createClient } from '@wix/sdk'; import { attachments } from '@wix/crm'; // Import the auth strategy for the relevant access type // Import the relevant host module if needed const myWixClient = createClient ({ modules: { attachments }, // Include the auth strategy and host as relevant }); async function deleteAttachment(identifiers) { const response = await myWixClient.attachments.deleteAttachment(identifiers); }; ``` ---