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())
{
"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
Revoke a Link Session
Kill a social-linking URL before it expires so it can no longer be used.
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())
{
"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."
}
Kill a linking URL before it expires. Once revoked, opening it does nothing — your user
sees an expired-link page instead of their profile.
Use this when a link went to the wrong person, was sent over a channel you no longer
trust, or is simply no longer wanted. Revoking is the reason a link session is worth
creating over the older signed URLs, which could not be recalled once sent.
Revoking is idempotent. Revoking an already-revoked link succeeds and returns the same
response, so a retry is always safe.
Revoking also removes any X/Twitter credentials you supplied for this link. Accounts
your user already connected through the link stay connected — revoking kills the link,
not the social accounts.
Header Parameters
Path Parameters
string
required
The
sessionId returned when the link was created.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())
{
"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."
}