---
title: "Upload a file and retrieve URL"
method: POST
path: "/urlshare"
tags: ["Urlshare"]
---

# Upload a file and retrieve URL

`POST /urlshare`

## Request

- Base URL: `https://apipie.ai`
- URL: `https://apipie.ai/urlshare`
- Auth: API key in header `Authorization`

Uploads a file to the server and returns a URL where the uploaded file can be accessed temporarily. This endpoint supports uploading images only, images shoudl be 1024x1024, or 1024x768 or 768x1024, otherwise they will be resized automatically. Files larger than 5mb will be rejected.

## Response `200`

File uploaded successfully and URL returned

- FileUploadResponse
  - `url` string: URL to access the uploaded file.

## Other responses

- `400`: No file uploaded or the file type is not supported
- `500`: Internal server error or unable to save file

---

[API](https://skmtc.dev/apipie/apis/introduction.md) · [All operations](https://skmtc.dev/apipie/apis/introduction/llms.txt) · [OpenAPI document](https://skmtc.dev/apipie/apis/introduction/revisions/f8386be4eb3f?raw)
