POST https://api.usecommune.com/newsletters/{newsletter}/website-assets Production. There is no separate sandbox host.

Store a website asset

Hands back a one-time URL to upload a file to, and the permanent address it will be served at. Needs content: write, and is a write.

For the things a page links to rather than contains: images, video, audio, fonts, and shared stylesheets or scripts. Put their URLs in your HTML; nothing here changes a page.

The bytes go straight from you to storage and never pass through this API or through a model, so url answers 404 until you have sent them. Send them with a PUT carrying the Content-Type you named, before upload.expires_at.

content_type is what the upload is minted for, and storage enforces it on the PUT itself: a file of a different type is refused there rather than stored wrongly. image/svg+xml is not accepted, because an SVG navigated to directly runs its own script on the storage origin, which every creator's assets share.

Storage not being configured on this deployment answers 503 rather than accepting a file Commune cannot keep.

Publishes no event.

Path parameters

  • string Required

Request Headers

  • string Required
  • string

Body

  • string Required
  • string Required
POST /newsletters/{newsletter}/website-assets
Loading...

Share your request

Use this link to easily share a pre-filled request of this operation. Everything you filled will be shared apart from the authentication fields.

Request URL

https://api-reference.usecommune.dev/explorer/operation/operation-createsiteasset

Send a delete request

It looks like you’re about to send a DELETE request to this API. This type of request carries a risk of permanent and irreversible data loss.

Are you sure you want to continue?
Response
Waiting for a request to be sent.