Download media from message
Download media (images, files, videos, audio) from a LinkedIn messaging URL. Uses account session cookies for authentication. No proxy is used — media is fetched directly from LinkedIn CDN. Supports URLs from www.linkedin.com/dms/prv/ (private messaging media) and media.licdn.com (CDN-hosted media).
/conversations/download-mediaCode Examples
curl -X POST 'https://api.connectsafely.ai/linkedin/conversations/download-media' \ -H 'Authorization: Bearer <your_api_key>' \ -H 'Content-Type: application/json' \ -d '{"accountId":"acc_12345","url":"https://linkedin.com/in/example"}'Download media (images, files, videos, audio) from a LinkedIn messaging URL. Uses account session cookies for authentication. No proxy is used — media is fetched directly from LinkedIn CDN. Supports URLs from www.linkedin.com/dms/prv/ (private messaging media) and media.licdn.com (CDN-hosted media).
Parameters
No parameters.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
accountId | string | Yes | LinkedIn account ID |
url | string | Yes | Media URL from message attachment (www.linkedin.com or media.licdn.com) |
Example
{
"accountId": "acc_12345",
"url": "https://linkedin.com/in/example"
}Responses
| Status | Description |
|---|---|
| 200 | Media file binary |
| 400 | Invalid media URL host |
| 401 | Unauthorized |
| 404 | Account not found |
| 500 | Server error |
400 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
400 Example
{
"error": "example_value"
}401 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
401 Example
{
"error": "example_value"
}404 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
404 Example
{
"error": "example_value"
}500 Response Parameters
| Name | Type | Description |
|---|---|---|
error | string |
500 Example
{
"error": "example_value"
}Upload message attachment
Upload a file to attach to a LinkedIn message (used with POST /conversations/send). Send the file as the RAW binary request body — do NOT use multipart/form-data. Set the request `Content-Type` header to the file's actual MIME type, and pass `accountId` and `filename` in the query string. To make an image render inline as a photo in the conversation, the `Content-Type` MUST be an image type (`image/png`, `image/jpeg`, `image/gif`, `image/webp`) — this uploads it as a LinkedIn photo asset. Any other content type is stored as a downloadable file attachment. The response's `attachment` object must then be passed to POST /conversations/send wrapped in a `file` key: `{ "attachments": [{ "file": <attachment> }] }`. Example: `curl -X POST "https://api.connectsafely.ai/linkedin/conversations/upload-attachment?accountId=acc_123&filename=photo.png" -H "Authorization: Bearer <api_key>" -H "Content-Type: image/png" --data-binary @photo.png`
Trigger conversation sync
Trigger a full sync of conversations from LinkedIn API to local database.
