---
title: "Upload media from a URL"
method: POST
path: "/api/assets/upload/url"
tags: ["Media"]
---

# Upload media from a URL

`POST /api/assets/upload/url`

## Request

- Base URL: `https://api-app.postnext.io`
- URL: `https://api-app.postnext.io/api/assets/upload/url`
- Auth: API key in header `x-api-key`

Downloads an image from `imageUrl` and stores it as an asset. `userId` is
currently required by the server.

## Request body

- object
  - `imageUrl` string, uri, required: Source image URL.
  - `userId` string, required: Your account uniqueId (required by the server).
  - `displayName` string
  - `description` string
  - `folderId` string
  - `source` 'user_upload' | 'unsplash' | 'pixabay' | 'pexels' | 'brand_scraper' | 'ai_generated' | 'other'

## Response `201`

Downloaded and stored

- object
  - `message` string
  - `asset` Asset
    - `_id` string
    - `teamId` string
    - `userId` string
    - `folderId` string, nullable
    - `name` string: Stored (S3) filename.
    - `originalName` string
    - `type` string: MIME type (stored under `type`, not `mimeType`).
    - `url` string, uri
    - `size` integer: Bytes.
    - `width` integer
    - `height` integer
    - `displayName` string
    - `source` 'user_upload' | 'unsplash' | 'pixabay' | 'pexels' | 'brand_scraper' | 'ai_generated' | 'other'
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: Missing imageUrl or userId
- `401`: Missing or invalid API key
- `403`: Storage limit reached or file exceeds remaining storage

---

[API](https://skmtc.dev/postnext/apis/postnext-public-api.md) · [All operations](https://skmtc.dev/postnext/apis/postnext-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/postnext/apis/postnext-public-api/revisions/c0bf3aa03271?raw)
