1. Media
swonkie.dev
  • Introduction
  • 🆕 MCP Server
  • Changelog
  • Quick Start
  • Social Networks
    • Instagram v2
    • Google My Business
    • YouTube
    • X (Twitter)
    • Threads
    • Instagram
    • LinkedIn
    • TikTok
    • Facebook
  • ✨ Andie
    • Generate an Image
      POST
  • Search
    • Search Profiles
      GET
  • Profiles
    • My Profiles
      GET
    • Competitors
      GET
  • Competitors
    • Add Competitor
      POST
    • Delete Competitor
      DELETE
  • Insights
    • Getting Started
    • My Profile Insights Metrics
    • My Profile Insights
    • My Profile Insights Posts
    • Competitor Insights Metrics
    • Competitor Insights
    • Competitor Insights Posts
  • Posts
    • Getting Started
    • Limits by Social Network
    • List Posts
    • Get a Post
    • Create a Post
    • Update a Post
    • Validate a Post
    • Delete a Post
    • Change Post Stage
  • Labels
    • Getting Started
    • List Labels
    • Create a Label
  • Media
    • Get a Media
      GET
    • Create a Media
      POST
    • Upload File to Media
      PUT
    • Confirm Uploaded Media
      PATCH
    • Delete a Media
      DELETE
    • Create a Media from URL
      POST
  • Examples
    • Publish
Back to Home
Back to Home
Login
  1. Media

Create a Media from URL

POST
/media/from-url
Creates a new media entry by importing a file from a public HTTPS URL. Swonkie fetches the file server-side and starts processing it immediately — no separate upload or confirmation step is needed.
This is a simpler alternative to the three-step POST /media → upload → PATCH /media/:mediaId flow. Use this endpoint when the file is already hosted at a publicly accessible URL.
Important: The URL must be publicly accessible over HTTPS without authentication. HTTP URLs, private/internal network addresses (e.g., 10.x.x.x, 192.168.x.x), and localhost are rejected to prevent server-side request forgery (SSRF). For videos, the file size is limited to 200 MB.

Notes#

The URL must be a public HTTPS URL — HTTP, private IPs, and localhost are rejected.
Videos imported via URL are limited to 200 MB.
Processing starts immediately — no confirmation step is required.
The returned status will initially be PROCESSING. Poll GET /media/:mediaId until it becomes SUCCESS before using the media in posts.
path, preview, type, and specs will be null while processing is in progress.
destinationType determines how the media can be used: POST_MEDIA for regular post content, POST_LINK for link preview customization.
Media files remain in your library and can be reused across multiple posts.

Request

Header Params

Body Params application/jsonRequired

Examples

Responses

🟢201
application/json
Bodyapplication/json

Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.swonkie.dev/v2/media/from-url' \
--header 'X-API-ID: ' \
--header 'X-API-KEY: ' \
--header 'Content-Type: application/json' \
--data '{
    "name": "product-video.mp4",
    "destinationType": "POST_MEDIA",
    "fileUrl": "https://example.com/videos/product-launch.mp4"
}'
Response Response Example
Media is created immediately and begins processing. Poll GET /media/:mediaId until status is SUCCESS before using the media in posts.
{
    "id": "TWVkaWFJZDk4NzY1NDMyMQ",
    "name": "product-video.mp4",
    "path": null,
    "preview": null,
    "type": null,
    "status": "PROCESSING",
    "specs": null,
    "createdAt": "2026-06-19T10:30:00.000Z"
}
Modified at 2026-06-22 10:55:56
Previous
Delete a Media
Next
Examples
Built with