Images

images

images.v1

Methods

Upload An Image -> Envelope<>
post/accounts/{account_id}/images/v1

Upload an image with up to 10 Megabytes using a single HTTP POST (multipart/form-data) request. An image can be uploaded by sending an image file or passing an accessible to an API url.

Delete Image -> Envelope<unknown>
delete/accounts/{account_id}/images/v1/{image_id}

Delete an image on Cloudflare Images. On success, all copies of the image are deleted and purged from cache.

Security

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example: Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY

Parameters
account_id: string

Account identifier tag.

image_id: string

Image unique identifier.

Response fields
errors: Array<>
messages: Array<>
result: unknown
success: true

Whether the API call was successful

Request example
200Example
Update Image -> Envelope<>
patch/accounts/{account_id}/images/v1/{image_id}

Update image access control. On access control change, all copies of the image are purged from cache.

Image Details -> Envelope<>
get/accounts/{account_id}/images/v1/{image_id}

Fetch details for a single image.

List Images -> V4PagePagination<{ images }>
get/accounts/{account_id}/images/v1

List up to 100 images with one request. Use the optional parameters below to get a specific range of images.

Domain types

Image = { id, filename, meta, 3 more... }

images.v1.blobs

Methods

Base Image -> unknown
get/accounts/{account_id}/images/v1/{image_id}/blob

Fetch base image. For most images this will be the originally uploaded file. For larger images it can be a near-lossless version of the original.

images.v1.keys

Methods

Delete Signing Key -> Envelope<{ keys }>
delete/accounts/{account_id}/images/v1/keys/{signing_key_name}

Delete signing key with specified name. Returns all keys available. When last key is removed, a new default signing key will be generated.

List Signing Keys -> Envelope<{ keys }>
get/accounts/{account_id}/images/v1/keys

Lists your signing keys. These can be found on your Cloudflare Images dashboard.

Create A New Signing Key -> Envelope<{ keys }>
put/accounts/{account_id}/images/v1/keys/{signing_key_name}

Create a new signing key with specified name. Returns all keys available.

Domain types

Key = { name, value }

images.v1.stats

Methods

Images Usage Statistics -> Envelope<>
get/accounts/{account_id}/images/v1/stats

Fetch usage statistics details for Cloudflare Images.

Domain types

Stat = { count }
ImagesV1

Variants

images.v1.variants

Methods

Create A Variant -> Envelope<{ variant }>
post/accounts/{account_id}/images/v1/variants

Specify variants that allow you to resize images for different use cases.

Delete A Variant -> Envelope<unknown>
delete/accounts/{account_id}/images/v1/variants/{variant_id}

Deleting a variant purges the cache for all images associated with the variant.

Update A Variant -> Envelope<{ variant }>
patch/accounts/{account_id}/images/v1/variants/{variant_id}

Updating a variant purges the cache for all images associated with the variant.

Variant Details -> Envelope<{ variant }>
get/accounts/{account_id}/images/v1/variants/{variant_id}

Fetch details for a single variant.

List Variants -> Envelope<>
get/accounts/{account_id}/images/v1/variants

Lists existing variants.

Domain types

Variant = { variants }

images.v2

Methods

List Images V2 -> Envelope<{ continuation_token, images }>
get/accounts/{account_id}/images/v2

List up to 10000 images with one request. Use the optional parameters below to get a specific range of images. Endpoint returns continuation_token if more images are present.

ImagesV2

Direct Uploads

images.v2.direct_uploads

Methods

Create Authenticated Direct Upload URL V2 -> Envelope<{ id, uploadURL }>
post/accounts/{account_id}/images/v2/direct_upload

Direct uploads allow users to upload images without API keys. A common use case are web apps, client-side applications, or mobile devices where users upload content directly to Cloudflare Images. This method creates a draft record for a future image. It returns an upload URL and an image identifier. To verify if the image itself has been uploaded, send an image details request (accounts/:account_identifier/images/v1/:identifier), and check that the draft: true property is not present.