---
title: "Add media from a URL"
method: POST
path: "/media"
tags: ["Media"]
---

# Add media from a URL

`POST /media`

## Request

- Base URL: `https://www.postbase.so/api/v1`
- URL: `https://www.postbase.so/api/v1/media`
- Auth: HTTP bearer

Download a file from a public https link into the media library.

## Request body

- object
  - `url` string, uri, required
  - `name` string

## Response `201`

Added

- object
  - `media` Media
    - `id` string, uuid, required
    - `name` string
    - `type` string, required: MIME type
    - `size_bytes` integer
    - `url` string, uri, required
    - `created_at` string, date-time

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid API key
- `429`: Rate limited

---

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