> ## Documentation Index
> Fetch the complete documentation index at: https://ayrshare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Comments

> किसी पोस्ट के अंतर्गत या तो एकल टिप्पणी या सभी टिप्पणियों को हटाएँ

export const XByoNotice = () => <Info>
  <strong>Targeting X/Twitter?</strong> Starting March 31, 2026, all X operations require your own API credentials. After linking X via OAuth, include these 2 headers in your request:
  <br /><br />
  <code>X-Twitter-OAuth1-Api-Key</code> — Your API Key (Consumer Key)<br />
  <code>X-Twitter-OAuth1-Api-Secret</code> — Your API Key Secret (Consumer Secret)
  <br /><br />
  <strong>One-time setup per Ayrshare account.</strong> You create one X Developer App and reuse the same API Key and Secret across every sub-profile / end-user you link. You do <em>not</em> create a new app per customer.
  <br /><br />
  Not linked yet? See the <a href="/dashboard/connect-social-accounts/x-twitter-byo-keys">full setup guide</a> to connect your X account.
  <br /><br />
  Your keys are never logged or stored by Ayrshare.
</Info>;

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

<XByoNotice />

Delete endpoint आपको या तो Ayrshare के माध्यम से भेजी गई टिप्पणियों को या Ayrshare के बाहर भेजी गई टिप्पणियों को हटाने की अनुमति देता है।

विभिन्न ID प्रकारों पर अधिक जानकारी के लिए कृपया [Comments Overview](/apis/comments/overview) देखें।

### Ayrshare से भेजी गई टिप्पणियों को हटाना

Ayrshare के माध्यम से भेजी गई एकल टिप्पणी या किसी पोस्ट के अंतर्गत सभी टिप्पणियों को हटाएँ।
कृपया अधिक जानकारी के लिए [Ayrshare Post ID](/apis/comments/overview#comments-with-ayrshare-post-id) और [Ayrshare Comment ID](/apis/comments/overview#comments-with-ayrshare-comment-id) देखें।

समर्थित प्लेटफ़ॉर्म्स: Bluesky, Facebook, Instagram, LinkedIn, Reddit, TikTok, X/Twitter, और YouTube।

### Ayrshare के बाहर भेजी गई टिप्पणियों को हटाना

किसी विशेष सोशल नेटवर्क के लिए लौटाए गए `commentId` का उपयोग करके Ayrshare के माध्यम से नहीं भेजी गई टिप्पणी को हटाएँ।
यह सोशल नेटवर्क्स से [Social Comment ID](/apis/comments/overview#comments-with-social-comment-id) है, Ayrshare ID नहीं।

समर्थित प्लेटफ़ॉर्म्स: Facebook, Instagram, TikTok, X/Twitter, और YouTube।

<Note>
  **TikTok — केवल स्व-लिखित टिप्पणियाँ।** TikTok पर, `DELETE /comments` केवल उन टिप्पणियों के लिए सफल होता है जिन्हें प्रमाणित TikTok अकाउंट ने स्वयं लिखा है (उदाहरण के लिए, वे उत्तर जो आपने Ayrshare के [reply endpoint](/apis/comments/reply-to-comment) के माध्यम से या सीधे TikTok ऐप के भीतर पोस्ट किए हैं)। किसी अन्य उपयोगकर्ता द्वारा लिखी गई टिप्पणी को हटाने का प्रयास — यहाँ तक कि आपके स्वयं के वीडियो पर छोड़ी गई एक टिप्पणी को भी — Ayrshare `code: 328` लौटाता है। यदि आपको अपने TikTok वीडियो पर तीसरे पक्ष की टिप्पणियों का मॉडरेशन करने की आवश्यकता है, तो support से संपर्क करें ताकि हम पुष्टि कर सकें कि आपके लिंक किए गए अकाउंट प्रकार के लिए क्या उपलब्ध है।
</Note>

उदाहरण के लिए, आप [Get Comments](/apis/comments/get-comments) endpoint का उपयोग करके `searchPlatformId` को `true` पर सेट करके किसी विशेष Instagram पोस्ट के लिए सभी टिप्पणियाँ प्राप्त करते हैं।

```http theme={"system"}
GET https://api.ayrshare.com/api/comments/18231730279304111?platform=instagram&searchPlatformId=true
```

लौटाए गए JSON में प्रत्येक टिप्पणी के लिए एक `commentId` होगा, जिसका उपयोग आप टिप्पणी को हटाने के लिए कर सकते हैं। `searchPlatformId` को `true` पर सेट करना याद रखें।

```json {5} theme={"system"}
{
  "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

<HeaderAPI />

## Path Parameters

<ParamField path="id" type="string" required>
  Ayrshare से भेजी गई टिप्पणियाँ हटाएँ:

  <ul className="custom-bullets">
    <li>[Ayrshare Post ID](/apis/comments/overview#comments-with-ayrshare-post-id) प्रदान करके Ayrshare के माध्यम से भेजी गई सभी टिप्पणियों को हटाएँ।</li>
    <li>[Ayrshare Comment ID](/apis/comments/overview#comments-with-ayrshare-comment-id) प्रदान करके एक एकल टिप्पणी हटाएँ।</li>
  </ul>

  Ayrshare के बाहर भेजी गई टिप्पणी हटाएँ:

  <ul className="custom-bullets">
    <li>
      सोशल नेटवर्क से [Social Comment
      ID](/apis/comments/overview#comments-with-social-comment-id) प्रदान करके एक एकल टिप्पणी हटाएँ।
    </li>

    <li>`searchPlatformId` को `true` पर सेट करना आवश्यक है।</li>
  </ul>
</ParamField>

## Body Parameters

<ParamField body="platforms" type="array">
  यदि Ayrshare के माध्यम से भेजी गई टिप्पणियाँ हटा रहे हैं तो आवश्यक। वे प्लेटफ़ॉर्म्स जहाँ से टिप्पणियाँ हटानी हैं।

  समर्थित प्लेटफ़ॉर्म्स: `bluesky`, `facebook`, `instagram`, `linkedin`, `reddit`, `threads`, `tiktok`, `twitter`, `youtube`।

  ```json Deleting comments sent via Ayrshare theme={"system"}
  DELETE /comments/:id // Ayrshare Post ID or Ayrshare Comment ID
  {
    "platforms": ["bluesky", "facebook", "instagram", "linkedin", "reddit", "threads", "tiktok", "twitter", "youtube"]
  }
  ```
</ParamField>

<ParamField body="platform" type="string">
  यदि [Social Comment
  ID](/apis/comments/overview#comments-with-social-comment-id) का उपयोग करके हटा रहे हैं, जो सोशल नेटवर्क्स से `commentId` है, तो आवश्यक।

  समर्थित प्लेटफ़ॉर्म्स: `bluesky`, `facebook`, `instagram`, `threads`, `tiktok`, `twitter`, `youtube`। एक समय में केवल एक प्लेटफ़ॉर्म समर्थित है।
</ParamField>

<ParamField body="searchPlatformId" type="boolean" default={false}>
  यदि [Social Comment
  ID](/apis/comments/overview#comments-with-social-comment-id) का उपयोग करके हटा रहे हैं, जो सोशल नेटवर्क्स से `commentId` है, तो आवश्यक — `true` पर सेट करें।

  ```json Deleting comments with Social Comment ID theme={"system"}
  DELETE /comments/:id // Social Comment ID
  {
    "searchPlatformId": true,
    // bluesky, facebook, instagram, threads, tiktok, twitter, youtube
    "platform": "facebook"
  }
  ```
</ParamField>

<ParamField body="hide" type="boolean" default={false}>
  केवल TikTok। किसी TikTok टिप्पणी को हटाने के बजाय सार्वजनिक दर्शकों से छिपाने के लिए `videoId` के साथ `true` पर सेट करें। सफलता प्रतिक्रिया `action: "hide"` लौटाती है और टिप्पणी को echo करती है। `videoId` के बिना `hide=true` भेजने पर HTTP `400` लौटता है।

  छिपाई गई टिप्पणियाँ TikTok Studio में वीडियो स्वामी को दिखाई देती रहती हैं।

  ```json Hiding a TikTok comment theme={"system"}
  DELETE /comments/:id // Social Comment ID
  {
    "searchPlatformId": true,
    "platform": "tiktok",
    "hide": true,
    "videoId": "7303719953248109358"
  }
  ```
</ParamField>

<ParamField body="videoId" type="string">
  किसी TikTok टिप्पणी को छिपाते समय आवश्यक (`hide=true`)। वह TikTok video ID जिससे टिप्पणी संबंधित है।
</ParamField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API_KEY" \
  -X DELETE https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ
  ```

  ```javascript JavaScript theme={"system"}
  const API_KEY = "API_KEY";

  fetch("https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ", {
    method: "DELETE",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
    },
  })
    .then((res) => res.json())
    .then((json) => console.log(json))
    .catch(console.error);
  ```

  ```python Python theme={"system"}
  import requests

  headers = {'Authorization': 'Bearer API_KEY'}

  r = requests.delete('https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ', headers=headers)

  print(r.json())
  ```

  ```php PHP theme={"system"}
  <?php

  $apiUrl = 'https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ'; // Replace with your post ID
  $apiKey = 'API_KEY';  // Replace 'API_KEY' with your actual API key

  $headers = [
      'Content-Type: application/json',
      'Authorization: Bearer ' . $apiKey,
  ];

  $curl = curl_init($apiUrl);
  curl_setopt_array($curl, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'DELETE',
      CURLOPT_HTTPHEADER => $headers
  ]);

  $response = curl_exec($curl);

  if ($response === false) {
      echo 'Curl error: ' . curl_error($curl);
  } else {
      echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
  }

  curl_close($curl);

  ```

  ```csharp C# theme={"system"}
  using System;
  using System.Net.Http;
  using System.Threading.Tasks;

  namespace CommentsDELETERequest_csharp
  {
      class CommentsDELETE
      {
          private static readonly HttpClient client = new HttpClient();

          static async Task Main(string[] args)
          {
              string API_KEY = "API_KEY";
              string url = "https://api.ayrshare.com/api/comments/Ut1fWU6XkqkMayHGnJZ";

              client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);

              try
              {
                  HttpResponseMessage response = await client.DeleteAsync(url);
                  response.EnsureSuccessStatusCode();
                  string responseBody = await response.Content.ReadAsStringAsync();
                  Console.WriteLine(responseBody);
              }
              catch (HttpRequestException e)
              {
                  Console.WriteLine($"Error: {e.Message}");
              }
          }
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200: Success Single Comment theme={"system"}
  {
    "status": "success",
    "bluesky": {
      "action": "delete",
      "status": "success",
      "id": "at://did:plc:d/app.bsky.feed.post/3lez", // Bluesky Social Comment ID
      "comment": "This is a comment"
    },
    "facebook": {
      "action": "delete",
      "status": "success",
      "id": "938010233_939392023", // Facebook Social Comment ID
      "comment": "This is a comment"
    },
    "instagram": {
      "action": "delete",
      "status": "success",
      "id": "18010439663043269",  // Instagram Social Comment ID
      "comment": "This is a comment"
    },
    "linkedin": {
      "action": "delete",
      "status": "success",
      "id": "7133271664032669696", // LinkedIn Social Comment ID
      "comment": "This is a comment"
    },
    "threads": {
      "action": "delete",
      "status": "success",
      "id": "18064102964006231"   // Threads Social Comment ID
    },
    "tiktok": {
      "action": "delete",
      "status": "success",
      "commentId": "7303719953248109358", // Deprecated December 1, 2023. Use the id field instead.
      "id": "7303719953248109358", // TikTok Social Comment ID
      "comment": "This is a comment"
    },
    "twitter": {
      "action": "delete",
      "status": "success",
      "id": "1633128546494459904", // Twitter Social Comment ID
      "comment": "This is a comment"
    },
    "youtube": {
      "action": "delete",
      "status": "success",
      "id": "Ugy2m5u-LS9M29Gn3hd4AaABAg", // YouTub Social Comment ID
      "comment": "This is a comment"
    }
  }
  ```

  ```json 200: Sucesss Multiple Comments theme={"system"}
  {
    "status": "success",
    "linkedin": [
      {
        "action": "delete",
        "status": "success",
        "id": "7090782997972410368", // LinkedIn Social Comment ID
        "comment": "This is a comment"
      },
      {
        "action": "delete",
        "status": "success",
        "id": "7090783025164103680", // LinkedIn Social Comment ID
        "comment": "This is a comment"
      }
    ],
    "twitter": [
      {
        "action": "delete",
        "posts": [
          {
            "action": "delete",
            "status": "success",
            "id": "1685017310942134272", // Twitter Social Comment ID
            "comment": "This is a comment"
          }
        ]
      },
      {
        "action": "delete",
        "posts": [
          {
            "action": "delete",
            "status": "success",
            "id": "1685017338184146946", // Twitter Social Comment ID
            "comment": "This is a comment"
          }
        ]
      }
    ],
    "facebook": [
      {
        "action": "delete",
        "status": "success",
        "id": "676770944469840_644047184361660", // Facebook Social Comment ID
        "comment": "This is a comment"
      },
      {
        "action": "delete",
        "status": "success",
        "id": "676770944469840_983782432932944", // Facebook Social Comment ID
        "comment": "This is a comment"
      }
    ]
  }
  ```

  ```json 200: Success Hide TikTok Comment theme={"system"}
  {
    "status": "success",
    "tiktok": {
      "action": "hide",
      "status": "success",
      "id": "7303719953248109358", // TikTok Social Comment ID
      "comment": "This is a comment"
    }
  }
  ```

  ```json 400: Comment id not found theme={"system"}
  {
    "action": "comments",
    "status": "error",
    "code": 219,
    "message": "Error getting comments. Please verify the comments are still available."
  }
  ```
</ResponseExample>
