# Private Nachricht mit Anhang/Upload über API

**URL:** https://meta.discourse.org/t/private-message-with-attachment-upload-via-api/384250
**Category:** Support
**Tags:** rest-api
**Created:** [29. September 2025 um 06:35 UTC](https://meta.discourse.org/t/private-message-with-attachment-upload-via-api/384250 "2025-09-29T06:35:34Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [29. September 2025 um 07:50 UTC](https://meta.discourse.org/t/private-message-with-attachment-upload-via-api/384250/2 "2025-09-29T07:50:09Z")

</div>

Hallo, Sie benötigen zwei API-Anfragen. Eine zum Hochladen der Datei, die die URL zurückgibt, und eine zum Erstellen des Beitrags, in den Sie die URL einfügen.

> [@How to upload a file via API and get it's URL?](https://meta.discourse.org/t/how-to-upload-a-file-via-api-and-get-its-url/123732/3?u=canapin):
>
> Also interested in this question I can’t find a way to upload a file to Topic and Post via the API. Perhaps someone can suggest a method. UPD: I figured it out, the method is described in the documentation and it works. Upload a file using “/uploads.json”, in response we get the Short URL of the uploaded file like “upload://ueNyWDEgHhXIuIdB472fy9T6.txt” We update the post with the second API request, adding a line like this to the very end of post[raw]: [filename.txt|attachment](upload://…

---

_[View the full topic](https://meta.discourse.org/t/private-message-with-attachment-upload-via-api/384250)._
