---
title: "Upload an image from a URL"
method: POST
path: "/media/{workspaceId}/assets/from-url"
tags: ["Media library"]
---

# Upload an image from a URL

`POST /media/{workspaceId}/assets/from-url`

## Request

- Base URL: `https://api.dynapictures.com`
- URL: `https://api.dynapictures.com/media/{workspaceId}/assets/from-url`
- Auth: HTTP bearer

Adds an image to the media library from a public URL or from base64.

## Path parameters

- `workspaceId` string, required

## Request body

- MediaFromUrlRequest
  - `url` string, uri: Public URL of the image. Set this or `base64`.
  - `base64` string: The image as base64. Set this or `url`.
  - `mimeType` string: The MIME type, mainly useful with `base64`.
  - `name` string: A display name.
  - `folderUid` string: The folder to put it in.

## Response `200`

The new asset.

- MediaAsset
  - `id` string, required: The ID of the asset.
  - `folder` boolean: Whether this asset is a folder rather than an image.
  - `mimeType` string: The MIME type of the image.
  - `filename` string: The file name.
  - `animated` boolean: Whether the image is animated.
  - `size` integer: The size in bytes.
  - `url` string, uri: URL of the image.
  - `thumbnailUrl` string, uri: URL of the thumbnail.
  - `dateCreated` string, date-time: When the asset was created.
  - `dateUpdated` string, date-time: When the asset was last changed.

## Other responses

- `400`: The request is invalid. `message` says why.
- `401`: The API key is missing or wrong.
- `403`: The plan limit is reached, the trial has expired, or the key has no access to this resource.
- `404`: The resource does not exist, or the key has no access to it.

---

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