Repost Post
Repost/share a LinkedIn post to your feed. Creates an instant repost without additional commentary.
POST
/linkedin/posts/repostRepost Post
Repost/share a LinkedIn post to your feed. Creates an instant repost without additional commentary. Requires either a post URL (will be scraped for URNs) or the share/ugcPost URN directly.
Authentication requiredLinkedIn Posts
Code Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/posts/repost' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"postUrl":"https://www.linkedin.com/posts/john-doe-123_topic-activity-7416350088379338752-jvIt"}'Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | No | LinkedIn account ID (uses default if not provided) |
postUrl | string | No* | LinkedIn post URL. Will be scraped to extract URNs. Either postUrl, shareUrn, or ugcPostUrn must be provided |
shareUrn | string | No* | Share URN of the post (e.g., "urn:li:share:7416350085304987648"). Use if you already have the URN |
ugcPostUrn | string | No* | UGC Post URN (e.g., "urn:li:ugcPost:7417595827650519041"). Used as fallback if shareUrn not available |
activityUrn | string | No | Activity URN for pre-repost signal (e.g., "urn:li:activity:7416350088379338752"). Optional but recommended for better engagement tracking |
Example (Using Post URL)
{
"postUrl": "https://www.linkedin.com/posts/john-doe-123_topic-activity-7416350088379338752-jvIt"
}Example (Using URNs Directly)
{
"shareUrn": "urn:li:share:7416350085304987648",
"activityUrn": "urn:li:activity:7416350088379338752"
}Example (Using ugcPostUrn)
Some posts use ugcPost URN instead of share URN. The API handles both:
{
"ugcPostUrn": "urn:li:ugcPost:7417595827650519041",
"activityUrn": "urn:li:activity:7417595829747793922"
}Responses
| Status | Description |
|---|---|
| 200 | Repost created successfully |
| 400 | Invalid request or unable to extract URNs |
200 Example
{
"success": true,
"message": "Repost successful",
"repostUrn": "urn:li:fsd_repost:urn:li:instantRepost:(urn:li:share:7416350085304987648,7417764382559920128)",
"resourceKey": "urn:li:fsd_repost:urn:li:instantRepost:(urn:li:share:7416350085304987648,7417764382559920128)",
"shareUrn": "urn:li:share:7416350085304987648",
"activityUrn": "urn:li:activity:7416350088379338752",
"accountId": "507f1f77bcf86cd799439011"
}400 Example (URN Extraction Failed)
{
"success": false,
"error": "Could not extract share URN or ugcPost URN from post. Please provide URN directly.",
"postDetails": {
"activityUrn": "urn:li:activity:7416350088379338752",
"ugcPostUrn": null,
"shareUrn": null
}
}URN Types Explained
LinkedIn posts can have different URN types depending on how they were created:
- shareUrn (
urn:li:share:...): Used for most posts shared through the feed - ugcPostUrn (
urn:li:ugcPost:...): Used for user-generated content, often video posts
The API automatically detects and uses the appropriate URN type. When providing a postUrl, the API scrapes the page to find the correct URN.
Tips
- Performance: If you already have the URNs from a previous API call (like
/posts/scrape), pass them directly to skip the scraping step - Activity URN: While optional, providing the
activityUrnsends a pre-repost signal that mimics browser behavior - Rate Limiting: Reposting too frequently may trigger LinkedIn's rate limits. Space out your reposts
