> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Import media from URL

> Store remote images/videos into the workspace library from JSON - direct URLs, social links, Unsplash, etc.

## 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](/api-reference/media/upload-file) instead.

### Request

<ParamField body="workspace_id" type="integer" required>
  Workspace that will own the imported files
</ParamField>

<ParamField body="urls" type="string[]" required>
  List of URLs to import (each must be a valid URL, max 2048 characters)
</ParamField>

<ParamField body="folder_id" type="integer">
  Optional media library folder id belonging to `workspace_id`
</ParamField>

### Response

<ResponseField name="media" type="array">
  Created library items; each includes **`id`** for use in `POST /posts` … `content[].media`
</ResponseField>

<ResponseField name="count_stored" type="integer">
  Number of items in `media`
</ResponseField>

<RequestExample>
  ```bash theme={null}
  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"
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "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
  }
  ```
</ResponseExample>

### See also

* [Media overview](/api-reference/media/overview)
* [Create post](/api-reference/posts/create)
