---
title: "Upload an image from a URL"
method: POST
path: "/api/upload-image-from-url"
tags: ["Images"]
---

# Upload an image from a URL

`POST /api/upload-image-from-url`

## Request

- Base URL: `https://api.sponsorunited.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.sponsorunited.com/api/upload-image-from-url`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/sponsorunited/apis/sponsorunited-api/docs/api/upload-image-from-url/post.ts> (a function with typed inputs; its response is checked against the schema)

Downloads an image from the provided URL, uploads it to S3, and returns the upload result. SVG and ICO images are drawn to a PNG before they are stored. An image that cannot be processed returns 422. When type is "asset", creates an Image record in the database.

## Request body

- UploadImageFromUrlRequest: Request schema for uploading an image from a URL to S3
  - `url` string, url, required: The URL of the image to upload
  - `type` string, nullable: The upload type category

## Response `200`

Upload result (S3 paths or Image asset record)

- object

## Other responses

- `422`: Validation error or invalid image

---

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