Skip to main content
POST
media
/
upload
/
url
curl -X POST "https://postsyncer.com/api/v1/media/upload/url" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 12,
    "urls": [
      "https://example.com/assets/hero.png"
    ]
  }'
{
  "media": [
    {
      "id": 915,
      "name": "hero.png",
      "url": "https://…",
      "mime_type": "image/png",
      "size": 98234,
      "is_processing": false,
      "type": "image",
      "ai_generated_id": null,
      "is_reference": false,
      "progress": 100,
      "alt": null
    }
  ],
  "count_stored": 1
}

Import media from URL

Send application/json with a list of URLs. The API downloads or resolves each URL (same pipeline as the in-app URL importer: direct image/video links, supported social post URLs, Unsplash, etc.) and creates media library rows in the given workspace. Response is 200 with media (array of created items) and count_stored. Some inputs produce more than one media object. URLs that fail validation or fetch may be skipped — media can be empty while still returning 200. For binary uploads from disk, use Upload from file instead.

Request

workspace_id
integer
required
Workspace that will own the imported files
urls
string[]
required
List of URLs to import (each must be a valid URL, max 2048 characters)
folder_id
integer
Optional media library folder id belonging to workspace_id

Response

media
array
Created library items; each includes id for use in POST /postscontent[].media
count_stored
integer
Number of items in media
curl -X POST "https://postsyncer.com/api/v1/media/upload/url" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "workspace_id": 12,
    "urls": [
      "https://example.com/assets/hero.png"
    ]
  }'
{
  "media": [
    {
      "id": 915,
      "name": "hero.png",
      "url": "https://…",
      "mime_type": "image/png",
      "size": 98234,
      "is_processing": false,
      "type": "image",
      "ai_generated_id": null,
      "is_reference": false,
      "progress": 100,
      "alt": null
    }
  ],
  "count_stored": 1
}

See also