---
title: "Attach media to a post draft from a public url"
method: POST
path: "/v1/posts/drafts/{id}/upload-url"
tags: ["Posts"]
---

# Attach media to a post draft from a public url

`POST /v1/posts/drafts/{id}/upload-url`

## Request

- Base URL: `https://api.taplio.com`
- URL: `https://api.taplio.com/v1/posts/drafts/{id}/upload-url`
- Auth: HTTP bearer

Fetches a publicly reachable https `url` and attaches the file to the draft, returning the updated draft. An unfetchable url, an unsupported type or an oversized file is rejected.

## Path parameters

- `id` string, required

## Request body

- UploadMediaFromUrlBody
  - `url` string, uri, required

## Response `200`

Updated draft with the attached media.

- Draft
  - `content` string, required
  - `created_at` string, date-time, required
  - `id` string, required
  - `media` MediaRef[]
    - `id` string, required
    - `type` 'image' | 'video' | 'document' | 'carousel', required
    - `url` string, uri
  - `status` 'draft', required

## Other responses

- `400`: Validation failed.
- `401`: Missing or invalid API key.
- `402`: Subscription payment failed.
- `403`: Subscription does not allow this request.
- `404`: Resource not found.
- `409`: Resource state precludes this request.
- `422`: Request semantically rejected.
- `429`: Rate limit exceeded.
- `500`: Internal server error.
- `503`: Upstream unavailable.

---

[API](https://skmtc.dev/taplio/apis/taplio-rest-api.md) · [All operations](https://skmtc.dev/taplio/apis/taplio-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/taplio/apis/taplio-rest-api/revisions/961302019f3f?raw)
