DELETE
/
comments
/
:id
Available on Premium, Business, Enterprise plans.

The delete endpoint allows you to either delete comments sent via Ayrshare or comments that were sent outside of Ayrshare.

Please see the Comments Overview for more information on the different ID types.

Delete Comments Sent from Ayrshare

Delete either a single comment or all comments under a post that were sent via Ayrshare. Please see the Ayrshare Post ID for more information.

Supported platforms: Facebook, Instagram, LinkedIn, Reddit, TikTok, X/Twitter, and YouTube.

Delete Comments Sent Outside of Ayrshare

Delete a comment that was not sent via Ayrshare by using the commentId returned for a particular social network. This is the Social Comment ID from the social networks, not the Ayrshare ID.

Supported platforms: Facebook, Instagram, TikTok, X/Twitter, and YouTube.

For example, you get all the comments for a particular Instagram post using the Get Comments endpoint with the searchPlatformId set to true.

GET https://api.ayrshare.com/api/comments/18231730279304111?platform=instagram&searchPlatformId=true

The returned JSON will have a commentId for each comment, which you can use to delete the comment. Remember to set the searchPlatformId to true.

{
  "instagram": [
    {
      "comment": "What an amazing comment",
      "commentId": "17969247335804735",
      "created": "2024-11-26T11:49:00Z",
      "from": {
        "id": "103038435208332",
        "username": "john_smith"
      },
      "hidden": false,
      "likeCount": 3,
      "platform": "instagram",
      "postId": "18231730279304333",
      "username": "john_smith"
    }
  ]
}

Header Parameters

Authorization
string
required
API Key of the Primary Profile.

Format: Authorization: Bearer API_KEY
Profile-Key
string
Profile Key of a User Profile.

Format: Profile-Key: PROFILE_KEY

Path Parameters

id
string
required

Top-level Ayrshare Post id or Social Comment ID commentId.

The top-level post id will delete all comments sent via Ayrshare.

The commentId will delete just the comment associated with the commentId.

Body Parameters

platforms
array

Required if deleting comments sent via Ayrshare. The platforms to delete comments from.

Supported platforms: facebook, instagram, linkedin, reddit, tiktok, twitter, youtube.

Deleting comments sent via Ayrshare
DELETE /comments/:id // Ayrshare Post ID
{
  "platforms": ["facebook", "instagram", "linkedin", "reddit", "tiktok", "twitter", "youtube"]
}
platform
string

Required if deleting using the Social Comment ID, which is the commentId from the social networks. Supported platforms: facebook, instagram, tiktok, twitter, youtube. Only one platform is supported at a time.

searchPlatformId
boolean
default: false

Required if deleting using the Social Comment ID, which is the commentId from the social networks, set to true.

Deleting comments with Social Comment ID
DELETE /comments/:id // Social Comment ID
{
  "searchPlatformId": true,
  // facebook, instagram, tiktok, twitter, youtube
  "platform": "facebook"
}