Upload a file from an existing URL.
Authorization
Send your API key in the Authorization header. It is under Settings → Developers → Public API in Ferra.
Body
urlstringrequiredURL of the file to upload
adjustbooleanAdjust the file to the platforms' limits after the upload: videos are scaled to a 1080 px short side (long side at most 1920 px) and re-encoded to H.264 MP4 with AAC audio, images larger than that are scaled down. Runs in the background, poll GET /media/{id}/status for the result. Defaults to false.
Request
curl -X POST 'https://tryferra.co/api/public/v1/upload-from-url' \
-H 'Authorization: your-api-key' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/image.png"
}'Responses
200File uploaded successfully
{
"id": "e639003b-f727-4a1e-87bd-74a2c48ae41e",
"name": "image.png",
"path": "https://tryferra.co/uploads/image.png",
"organizationId": "85460a39-6329-4cf4-a252-187ce89a3480",
"createdAt": "2024-12-14T08:18:54.274Z",
"updatedAt": "2024-12-14T08:18:54.274Z"
}Fetch a remote URL and store the result as a Ferra media asset. Useful when your media already lives on a CDN or external storage and you don't want to round-trip it through your client.
Requirements for the source URL
Example
curl -X POST "https://tryferra.co/api/public/v1/upload-from-url" \
-H "Authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/photo.jpg"}'
Response shape matches Upload File.
Add "adjust": true to the body to adjust the file to the platforms' limits after the upload. It works the same as on Upload File.
When to prefer multipart upload
If your source URLs are slow or unreliable, the round-trip through Ferra can fail or take a long time. For best results:
- Cache stable, fast HTTPS source URLs (S3, R2, Cloudflare Images, etc.).
- For one-off uploads, pre-download the file locally and POST it to
/public/v1/uploadinstead. - Don't link to signed URLs that may expire before Ferra fetches them.
See Uploads troubleshooting for common failure modes.