---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.2
alternate:
  - https://yandex.com/dev/direct/doc/dg-v4/en/live/AdImage_Delete.md
  - https://yandex.com/dev/direct/doc/dg-v4/ru/live/AdImage_Delete.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/direct/doc/dg-v4/en/llms.txt

# Delete
Deletes images.
If an image with the specified hash was not found, a code [271](https://yandex.com/dev/direct/doc/dg-v4/en/reference/ErrorCodes.md#Error271) error occurs. If the image is associated with an ad or has been shown at least once, a code [80](https://yandex.com/dev/direct/doc/dg-v4/en/reference/ErrorCodes.md#ErrorCode80) error occurs.


{% note alert %}

An error deleting an image causes the entire operation to be canceled, and none of the images will be deleted.

{% endnote %}


## Input data

The input data structure in JSON is shown below.

```javascript
{
   "method": "AdImage",
   "param": {
      /* AdImageRequest */
      "Action": (string),
      "SelectionCriteria": {
         /* AdImageSelectionCriteria */
         "Logins": [
            (string)
            ...
         ],
         "AdImageHashes": [
            (string)
            ...
         ]
      }
   }
}
```

Parameters are described below.


#|
||
**<sup >Parameter</sup>**
|
**<sup >Description</sup>**
|
**<sup >Required</sup>**
||

||
**<sub >AdImageRequest object</sub>**
||
||
`Action`
|
Action: Delete.
|
Yes
||
||
`SelectionCriteria`
|
The `AdImageSelectionCriteria` object, which contains criteria for selecting the images to delete.
|
Yes
||

||
**<sub >AdImageSelectionCriteria object</sub>**
||
||
`Logins`
|
For agencies, an array containing a single element: the username of the client to perform the operation for.

For advertisers, this parameter is ignored.
|
For agencies
||
||
`AdImageHashes`
|
Array containing the hashes of images (no more than 10,000).
|
Yes
||

||
**Notes**
||
||
For agencies, it deletes images that match both criteria simultaneously: the image hash is specified in the `AdImageHashes` array, and the username of the image's owner is specified in the `usernames` array.
||
|#

## Output data

For a successful operation, an empty structure is returned:

```javascript
{ }
```

## Examples of input data

# Python

```python
{
   'Action': 'Delete',
   'SelectionCriteria': {
      'Logins': ['agrom'],
      'AdImageHashes': ['c6da811f75221196dd5b1a8ca703344b','549c741215d67644e93ca8ef446df1fc']
   }
}
```

# PHP

```php
array(
   'Action' => 'Delete',
   'SelectionCriteria' => array(
      'Logins' => array('agrom'),
      'AdImageHashes' => array('c6da811f75221196dd5b1a8ca703344b','549c741215d67644e93ca8ef446df1fc')
   )
)
```

# Perl

```perl
{
   'Action' => 'Delete',
   'SelectionCriteria' ={
      'Logins' => ['agrom'],
      'AdImageHashes' => ['c6da811f75221196dd5b1a8ca703344b','549c741215d67644e93ca8ef446df1fc']
   }
}
```

