POST https://api.usecommune.com/articles/{article}/images Production. There is no separate sandbox host.

Store an image for an article

Stores an image for this article and answers with the URL it is served at, so whatever writes the article never needs somewhere of its own to host one. Needs content: write.

Two ways in, chosen by the body:

  • source_url: Commune downloads the image and stores a copy. For an image you hold as a link, including a generated one on a link that will expire. It has to be a public http or https URL on the standard port; private and local network addresses are refused, redirects included.
  • content_type: Commune answers with a one-time upload URL and the image's final url. PUT the file's bytes to upload.url with the upload.headers, before upload.expires_at. The bytes go straight to storage, so a file on disk never has to pass through a model or through this API. Until the upload is made, url answers 404.

Either way the image is a JPEG, PNG, WebP or GIF of at most 10MB, and the article itself is not changed: put the url in the body's Markdown (![alt](url)) or in image_url with Update an article (PATCH /articles/{article}).

Path parameters

  • string Required

Request Headers

  • string
  • string Required

Body

  • string(uri)
  • string
POST /articles/{article}/images
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-createarticleimage

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.