Skip to content

DeletePost#

Beta version

The functionality is in beta. Features may change and may also work unstably.

The method uses the limits on the number of requests per second.

Request#

To delete a post, you have to execute a request at:

POST
{{apiUrl}}/waInstance{{idInstance}}/deletePost/{{apiTokenInstance}}

For apiUrl, idInstance and apiTokenInstance request parameters, refer to the Before you start section.

Request parameters#

Parameter Type Mandatory Description
postId string Yes The post identifier

Request body example#

{
    "postId": "2907515653209522683"
}

By a link:

{
    "postId": "https://www.instagram.com/p/ChZkhT4cQH7/"
}

Response#

Response parameters#

Field Type Description
postId string The identifier of the deleted post - in the same form it was in the request

Response body example#

{
    "postId": "2907515653209522683"
}

DeletePost errors#

For a list of errors common to all methods, refer to the Common errors section

HTTP code Error ID Description
400 Bad Request
Validation failed
Validation error

Refusals in the notification#

The command is executed through the queue: the method responds with 200 and postId at once. If the command could not be executed, the deletePostStatus notification arrives with status = failed, the reason is in the description field:

description Description
post 2907515653209522683 belongs to another account The post belongs to another account
reel 3977953643059237032 belongs to another account The Reel belongs to another account
not found There is no post with this identifier in Instagram

Request examples#

import requests

url = "{{apiUrl}}/waInstance{{idInstance}}/deletePost/{{apiTokenInstance}}"

payload = {"postId": "2907515653209522683"}
headers = {'Content-Type': 'application/json'}

response = requests.post(url, json=payload, headers=headers)

print(response.text.encode('utf8'))
curl --location '{{apiUrl}}/waInstance{{idInstance}}/deletePost/{{apiTokenInstance}}' \
--header 'Content-Type: application/json' \
--data-raw '{"postId": "2907515653209522683"}'