curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X GET 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}`, {
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.get(
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
headers=headers)
print(response.json())
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "active", // pending | active | expired | revoked - see Link States above.
"createdAt": "2026-09-01T08:03:26.838Z", // When the link was created, as an ISO 8601 timestamp.
"expiresAt": "2026-09-02T08:03:26.838Z", // When the link stops working.
"firstUsedAt": "2026-09-01T08:14:02.104Z", // When the link was first opened. Absent if it never has been.
"lastUsedAt": "2026-09-01T08:14:02.104Z", // When the link was most recently opened. Absent if it never has been.
"useCount": 1 // How many times the link has been opened. A reload or an OAuth retry increments this.
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "pending", // Created but never opened, so firstUsedAt and lastUsedAt are absent.
"createdAt": "2026-09-01T08:03:26.838Z",
"expiresAt": "2026-09-02T08:03:26.838Z",
"useCount": 0
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}
Profiles
Get a Link Session
Check whether a social-linking URL has been opened, is still valid, or has been revoked.
GET
/
profiles
/
link-sessions
/
{sessionId}
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X GET 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}`, {
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.get(
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
headers=headers)
print(response.json())
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "active", // pending | active | expired | revoked - see Link States above.
"createdAt": "2026-09-01T08:03:26.838Z", // When the link was created, as an ISO 8601 timestamp.
"expiresAt": "2026-09-02T08:03:26.838Z", // When the link stops working.
"firstUsedAt": "2026-09-01T08:14:02.104Z", // When the link was first opened. Absent if it never has been.
"lastUsedAt": "2026-09-01T08:14:02.104Z", // When the link was most recently opened. Absent if it never has been.
"useCount": 1 // How many times the link has been opened. A reload or an OAuth retry increments this.
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "pending", // Created but never opened, so firstUsedAt and lastUsedAt are absent.
"createdAt": "2026-09-01T08:03:26.838Z",
"expiresAt": "2026-09-02T08:03:26.838Z",
"useCount": 0
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}
Check the state of a linking URL you created with
Create a Link Session — whether your user has
opened it, whether it is still valid, and how many times it has been used.
Useful when you want to know if a user has started connecting their accounts without
asking them, or to confirm a link is dead before creating a replacement.
A
sessionId that does not exist, or that belongs to another account, returns the same
not found response. This is deliberate, so the endpoint cannot be used to discover
whether an identifier is real.Header Parameters
Path Parameters
string
required
The
sessionId returned when the link was created.Link States
Thestate field is one of:
pending: created, never opened.active: opened at least once, still within its window.expired: pastexpiresAt.revoked: killed with Revoke a Link Session.
revoked even after its window passes, since that is the more
useful answer.
curl \
-H "Authorization: Bearer API_KEY" \
-H 'Profile-Key: PROFILE_KEY' \
-X GET 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}`, {
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.get(
'https://api.ayrshare.com/api/profiles/link-sessions/SESSION_ID',
headers=headers)
print(response.json())
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "active", // pending | active | expired | revoked - see Link States above.
"createdAt": "2026-09-01T08:03:26.838Z", // When the link was created, as an ISO 8601 timestamp.
"expiresAt": "2026-09-02T08:03:26.838Z", // When the link stops working.
"firstUsedAt": "2026-09-01T08:14:02.104Z", // When the link was first opened. Absent if it never has been.
"lastUsedAt": "2026-09-01T08:14:02.104Z", // When the link was most recently opened. Absent if it never has been.
"useCount": 1 // How many times the link has been opened. A reload or an OAuth retry increments this.
}
{
"status": "success",
"sessionId": "c7a2434e72e91bde27579efde0fd6dd0b74ceee29a471fd368407f273708c2e8",
"state": "pending", // Created but never opened, so firstUsedAt and lastUsedAt are absent.
"createdAt": "2026-09-01T08:03:26.838Z",
"expiresAt": "2026-09-02T08:03:26.838Z",
"useCount": 0
}
{
"action": "link session",
"status": "error",
"code": 502,
"message": "Social linking session not found. Please request a new linking URL."
}