---
title: "deleteAttachmentVersion"
canonical: "https://support.appfire.com/space/PSCONF/15305221/deleteAttachmentVersion"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | deleteAttachmentVersion(pageId, attachmentName, version) | **Package** |  |
> | **Alias** | deleteAttachmentVersion(attachmentId, version) | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Deletes the attachment version.

Deletes the attachment version.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | pageId | Number | Yes | The ID of the page with the selected attachment. |
> | attachmentName | String | Yes | The name of the attachment whose version will be deleted. |
> | version | Number | Yes | The version number to delete. |

### Or

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | attachmentId | Number | Yes | The ID of the attachment having the version you want to delete. |
> | version | Number | No | The version number to delete. |

## Return Type

**Boolean (true/false)**

Returns "true" if the attachment version was deleted successfully and "false" otherwise. If returned "false" check the log for a detailed reason on why it failed.

## Examples

### Example 1

```javascript
return deleteAttachmentVersion(12365, "attachment.ext", 2);
```

### Example 2

```javascript
return deleteAttachmentVersion(12365, 3);
```

## See also

> Macro (contentbylabel)