POST
/
v1
/
images
/
{image_id}
/
publish
curl --request POST \
  --url https://api.img-processing.com/v1/images/{image_id}/publish \
  --header 'x-api-key: <api-key>'
{
  "id": "image_etm0g3x5iap4cld1qcfsjvo2",
  "name": "Processed Image",
  "url": "https://storage.img-processing.com/images/image_etm0g3x5iap4cld1qcfsjvo2",
  "width": 460,
  "height": 460,
  "format": "jpeg",
  "size": 282000,
  "created_at": "2021-09-01T12:00:00.000Z"
}

Description

By default, all images created using the API are private and can only be accessed by the user who created them via the API key. This endpoint allows you to make a private image public, so that it can be accessed by anyone.

Publishing an image adds it to a CDN, allowing it to be accessed faster and more efficiently.

After publishing an image, the url field of the image object will be updated with the public URL. You can still access the image using the private download URL, but the public URL can be shared with others.


Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

image_id
string
required

The unique identifier of the image. This identifier is used to reference the image in subsequent requests.

Response

201
application/json

The API will return the Image object in the response body.

The Image object represents an image processed using the IMG Processing API. The object contains information about the image, such as its URL, size, and format. The Image object is returned in the response body of all image processing requests.