curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X DELETE https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID
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);
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
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);
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}");
}
}
}
}
{
"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.
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}
Profiles
إبطال Link Session
أوقف عنوان URL لربط الشبكات الاجتماعية قبل انتهاء صلاحيته بحيث لا يمكن استخدامه بعد ذلك.
DELETE
/
profiles
/
link-sessions
/
{sessionId}
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X DELETE https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID
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);
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
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);
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}");
}
}
}
}
{
"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.
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}
أوقف رابط ربط قبل انتهاء صلاحيته. بمجرد إبطاله، لا يُجدي فتحه شيئًا — يرى مستخدمك صفحة
رابط منتهي الصلاحية بدلًا من ملفه.
استخدم هذا عندما يذهب رابط إلى الشخص الخطأ، أو يُرسل عبر قناة لم تعد تثق بها، أو ببساطة
لم يعد مرغوبًا فيه. الإبطال هو ما يجعل إنشاء Link Session أجدى من عناوين URL الموقّعة
القديمة، التي لم يكن بالإمكان استرجاعها بعد إرسالها.
الإبطال عملية idempotent (لا يتغير أثرها بالتكرار). إبطال رابط مُبطل مسبقًا ينجح ويُعيد
الاستجابة نفسها، لذا فإن إعادة المحاولة آمنة دائمًا.
يُزيل الإبطال أيضًا أي بيانات اعتماد X/Twitter زوّدتها لهذا الرابط. أما الحسابات التي
ربطها مستخدمك بالفعل عبر الرابط فتبقى متصلة — الإبطال يوقف الرابط، لا الحسابات
الاجتماعية.
معاملات الترويسة
معاملات المسار
string
مطلوب
قيمة
sessionId المُعادة عند إنشاء الرابط.curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X DELETE https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID
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);
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
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);
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}");
}
}
}
}
{
"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.
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}