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."
}
リンク用 URL を期限切れ前に無効化します。いったん失効させると、開いても何も起こりません — ユーザーには
プロファイルの代わりに期限切れリンクのページが表示されます。
リンクを誤った相手に送ってしまった場合、信頼できなくなった経路で送信した場合、あるいは単に不要になった
場合に使用してください。失効できることこそが、旧来の署名付き URL よりも Link Session を作成する価値が
ある理由です。署名付き URL は、いったん送ると取り消すことができませんでした。
失効は冪等です。すでに失効済みのリンクを失効させても成功し、同じレスポンスが返されるため、再試行は
常に安全です。
失効すると、このリンクのために指定した 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."
}