Facebook Pixel
APILinkedIn Posts

Repost a LinkedIn post

Repost/share a LinkedIn post to your feed. This creates an instant repost without additional commentary. Requires either a post URL (will be scraped for URNs) or the share/ugcPost URN directly. The activityUrn is optional but helps with engagement tracking.

POST/posts/repost
Authentication requiredPosts

Code Examples

curl -X POST 'https://api.connectsafely.ai/linkedin/posts/repost' \
-H 'Authorization: Bearer <your_api_key>' \
-H 'Content-Type: application/json' \
-d '{"accountId":"acc_12345","postUrl":"https://linkedin.com/posts/example-post","shareUrn":"urn:li:example:123456","ugcPostUrn":"urn:li:share:7012345678901234567","activityUrn":"urn:li:example:123456"}'

Parameters

No parameters.

Request Body

FieldTypeRequiredDescription
accountIdstringNoLinkedIn account ID to use. If not provided, uses the default account.
postUrlstringNoFull URL of the LinkedIn post to repost. Will be scraped to extract URNs.
shareUrnstringNoShare URN of the post (e.g., "urn:li:share:7416350085304987648"). Use if you already have the URN.
ugcPostUrnstringNoUGC Post URN (e.g., "urn:li:ugcPost:7417595827650519041"). Used as fallback if shareUrn not available.
activityUrnstringNoActivity URN for pre-repost signal (e.g., "urn:li:activity:7416350088379338752"). Optional but recommended.

Example

{
  "accountId": "acc_12345",
  "postUrl": "https://linkedin.com/posts/example-post",
  "shareUrn": "urn:li:example:123456",
  "ugcPostUrn": "urn:li:share:7012345678901234567",
  "activityUrn": "urn:li:example:123456"
}

Responses

StatusDescription
200Repost created successfully
400Invalid request or unable to extract URNs
401Unauthorized - Invalid or missing API key
500Server error - Failed to repost

200 Response Parameters

NameTypeDescription
successboolean
messagestring
repostUrnstringURN of the created repost
resourceKeystringResource key of the repost
shareUrnstringShare URN that was reposted
ugcPostUrnstringUGC Post URN that was reposted (if shareUrn not available)
activityUrnstringActivity URN used for tracking
accountIdstringLinkedIn account ID that performed the repost

200 Example

{
  "success": true,
  "message": "Repost successful",
  "repostUrn": "urn:li:fsd_repost:urn:li:instantRepost:(urn:li:share:7430667225633550337,7432008152021254154)",
  "resourceKey": "urn:li:fsd_repost:urn:li:instantRepost:(urn:li:share:7430667225633550337,7432008152021254154)",
  "shareUrn": "urn:li:share:7430667225633550337",
  "activityUrn": "urn:li:activity:7430667226199830528",
  "accountId": "696ce9e780e0483585e4e553"
}

400 Response Parameters

NameTypeDescription
successboolean
errorstring
shareUrnstring
ugcPostUrnstring

400 Example

{
  "error": "Either postUrl, shareUrn, or ugcPostUrn must be provided",
  "success": false
}

401 Response Parameters

NameTypeDescription
errorstring

401 Example

{
  "error": "Unauthorized"
}

500 Response Parameters

NameTypeDescription
errorstring

500 Example

{
  "error": "Failed to repost",
  "success": false
}