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

# Link Session रद्द करें

> किसी सोशल-लिंकिंग URL को समय समाप्त होने से पहले निष्क्रिय करें ताकि उसका आगे उपयोग न हो सके।

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>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/docs/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="/docs/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="/docs/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

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

किसी लिंकिंग URL को समय समाप्त होने से पहले निष्क्रिय करें। एक बार रद्द होने के बाद, उसे खोलने
पर कुछ नहीं होता — आपके उपयोगकर्ता को उनके प्रोफ़ाइल के बजाय expired-link पेज दिखाई देता है।

इसका उपयोग तब करें जब कोई लिंक ग़लत व्यक्ति के पास चला गया हो, ऐसे चैनल से भेजा गया हो जिस पर
अब आपको भरोसा नहीं है, या बस अब उसकी ज़रूरत नहीं रही हो। रद्द कर पाना ही वह कारण है जिससे
link session पुराने साइन किए हुए URL से बेहतर है, जिन्हें एक बार भेजने के बाद वापस नहीं लिया जा
सकता था।

<Note>
  रद्द करना idempotent है। पहले से रद्द किए गए लिंक को रद्द करना सफल होता है और वही प्रतिक्रिया
  लौटाता है, इसलिए पुनः प्रयास हमेशा सुरक्षित है।
</Note>

<Info>
  रद्द करने से इस लिंक के लिए आपकी दी गई कोई भी X/Twitter क्रेडेंशियल भी हटा दी जाती हैं। जो
  अकाउंट आपके उपयोगकर्ता ने लिंक के माध्यम से पहले ही कनेक्ट कर लिए हैं, वे कनेक्टेड रहते हैं —
  रद्द करने से लिंक निष्क्रिय होता है, सोशल अकाउंट नहीं।
</Info>

## हेडर पैरामीटर

<HeaderAPI profileKeyRequired={true} />

## पाथ पैरामीटर

<ParamField path="sessionId" type="string" required>
  लिंक बनाए जाने पर लौटाया गया `sessionId`।
</ParamField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API_KEY" \
  -H 'Profile-Key: PROFILE_KEY' \
  -X DELETE https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID
  ```

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

  fetch(`https://api.ayrshare.com/api/profiles/link-sessions/${SESSION_ID}`, {
    method: "DELETE",
    headers: {
      Authorization: `Bearer ${API_KEY}`,
      "Profile-Key": PROFILE_KEY,
    },
  })
    .then((res) => res.json())
    .then((json) => console.log(json))
    .catch(console.error);
  ```

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

  headers = {'Authorization': 'Bearer API_KEY',
          'Profile-Key': 'PROFILE_KEY'}

  response = requests.delete(
      'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
      headers=headers)
  print(response.json())
  ```

  ```php PHP theme={"system"}
  <?php
  require 'vendor/autoload.php';    // Composer auto-loader using Guzzle. See .../guzzlephp.org/en/stable/overview.html

  $client = new GuzzleHttp\Client();
  $res = $client->request(
      'DELETE',
      'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
      [
          'headers' => [
              'Authorization' => 'Bearer API_KEY',
              'Profile-Key'   => 'PROFILE_KEY'
          ]
      ]
  );

  echo json_encode(json_decode($res->getBody()), JSON_PRETTY_PRINT);
  ```

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

  namespace RevokeLinkSession_csharp
  {
    class RevokeLinkSession
    {
        static async Task Main(string[] args)
        {
            string API_KEY = "API_KEY";
            string PROFILE_KEY = "PROFILE_KEY";
            string url = "https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID";

            try
            {
                using (var client = new HttpClient())
                {
                    client.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);
                    client.DefaultRequestHeaders.Add("Profile-Key", PROFILE_KEY);

                    HttpResponseMessage response = await client.DeleteAsync(url);
                    response.EnsureSuccessStatusCode();

                    string responseBody = await response.Content.ReadAsStringAsync();
                    Console.WriteLine(responseBody);
                }
            }
            catch (HttpRequestException e)
            {
                Console.WriteLine($"HTTP request error: {e.Message}");
            }
        }
    }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"system"}
  {
      "status": "success",
      "sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
      "state": "revoked",  // Always "revoked" on success.
      "revokedAt": "2026-09-01T09:22:11.507Z"  // When the link was revoked. On a repeat revoke, the ORIGINAL time - not the retry.
  }
  ```

  ```json 404: Not Found theme={"system"}
  {
    "action": "link session",
    "status": "error",
    "code": 502,
    "message": "Social linking session not found. Please request a new linking URL."
  }
  ```
</ResponseExample>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.