Skip to content
Start here

Images

ImagesV1

List images
Deprecated
images.v1.list(V1ListParams**kwargs) -> SyncV4PagePagination[V1ListResponse]
GET/accounts/{account_id}/images/v1
Image details
images.v1.get(strimage_id, V1GetParams**kwargs) -> Image
GET/accounts/{account_id}/images/v1/{image_id}
Upload an image
images.v1.create(V1CreateParams**kwargs) -> Image
POST/accounts/{account_id}/images/v1
Update image
images.v1.edit(strimage_id, V1EditParams**kwargs) -> Image
PATCH/accounts/{account_id}/images/v1/{image_id}
Delete image
images.v1.delete(strimage_id, V1DeleteParams**kwargs) -> V1DeleteResponse
DELETE/accounts/{account_id}/images/v1/{image_id}
ModelsExpand Collapse
class Image:
id: Optional[str]

Image unique identifier.

maxLength32
creator: Optional[str]

Can set the creator field with an internal user ID.

maxLength1024
filename: Optional[str]

Image file name.

maxLength255
meta: Optional[object]

User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes.

require_signed_urls: Optional[bool]

Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image.

uploaded: Optional[datetime]

When the media item was uploaded.

formatdate-time
variants: Optional[List[str]]

Object specifying available variants for an image.

class V1ListResponse:
images: Optional[List[Image]]
id: Optional[str]

Image unique identifier.

maxLength32
creator: Optional[str]

Can set the creator field with an internal user ID.

maxLength1024
filename: Optional[str]

Image file name.

maxLength255
meta: Optional[object]

User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes.

require_signed_urls: Optional[bool]

Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image.

uploaded: Optional[datetime]

When the media item was uploaded.

formatdate-time
variants: Optional[List[str]]

Object specifying available variants for an image.

Union[str, object]
One of the following:
str
object

ImagesV1Keys

List Signing Keys
images.v1.keys.list(KeyListParams**kwargs) -> KeyListResponse
GET/accounts/{account_id}/images/v1/keys
Create a new Signing Key
images.v1.keys.update(strsigning_key_name, KeyUpdateParams**kwargs) -> KeyUpdateResponse
PUT/accounts/{account_id}/images/v1/keys/{signing_key_name}
Delete Signing Key
images.v1.keys.delete(strsigning_key_name, KeyDeleteParams**kwargs) -> KeyDeleteResponse
DELETE/accounts/{account_id}/images/v1/keys/{signing_key_name}
ModelsExpand Collapse
class Key:
name: Optional[str]

Key name.

value: Optional[str]

Key value.

class KeyListResponse:
keys: Optional[List[Key]]
name: Optional[str]

Key name.

value: Optional[str]

Key value.

class KeyUpdateResponse:
keys: Optional[List[Key]]
name: Optional[str]

Key name.

value: Optional[str]

Key value.

class KeyDeleteResponse:
keys: Optional[List[Key]]
name: Optional[str]

Key name.

value: Optional[str]

Key value.

ImagesV1Stats

Images usage statistics
images.v1.stats.get(StatGetParams**kwargs) -> Stat
GET/accounts/{account_id}/images/v1/stats
ModelsExpand Collapse
class Stat:
count: Optional[Count]
allowed: Optional[float]

Cloudflare Images allowed usage.

current: Optional[float]

Cloudflare Images current usage.

ImagesV1Variants

List variants
images.v1.variants.list(VariantListParams**kwargs) -> Variant
GET/accounts/{account_id}/images/v1/variants
Variant details
images.v1.variants.get(strvariant_id, VariantGetParams**kwargs) -> VariantGetResponse
GET/accounts/{account_id}/images/v1/variants/{variant_id}
Create a variant
images.v1.variants.create(VariantCreateParams**kwargs) -> VariantCreateResponse
POST/accounts/{account_id}/images/v1/variants
Update a variant
images.v1.variants.edit(strvariant_id, VariantEditParams**kwargs) -> VariantEditResponse
PATCH/accounts/{account_id}/images/v1/variants/{variant_id}
Delete a variant
images.v1.variants.delete(strvariant_id, VariantDeleteParams**kwargs) -> VariantDeleteResponse
DELETE/accounts/{account_id}/images/v1/variants/{variant_id}
ModelsExpand Collapse
class Variant:
variants: Optional[Variants]
hero: Optional[VariantsHero]
id: str
maxLength99
options: VariantsHeroOptions

Allows you to define image resizing sizes for different use cases.

fit: Literal["scale-down", "contain", "cover", 2 more]

The fit property describes how the width and height dimensions should be interpreted.

One of the following:
"scale-down"
"contain"
"cover"
"crop"
"pad"
height: float

Maximum height in image pixels.

minimum1
metadata: Literal["keep", "copyright", "none"]

What EXIF data should be preserved in the output image.

One of the following:
"keep"
"copyright"
"none"
width: float

Maximum width in image pixels.

minimum1
never_require_signed_urls: Optional[bool]

Indicates whether the variant can access an image without a signature, regardless of image access control.

class VariantGetResponse:
variant: Optional[Variant]
id: str
maxLength99
options: VariantOptions

Allows you to define image resizing sizes for different use cases.

fit: Literal["scale-down", "contain", "cover", 2 more]

The fit property describes how the width and height dimensions should be interpreted.

One of the following:
"scale-down"
"contain"
"cover"
"crop"
"pad"
height: float

Maximum height in image pixels.

minimum1
metadata: Literal["keep", "copyright", "none"]

What EXIF data should be preserved in the output image.

One of the following:
"keep"
"copyright"
"none"
width: float

Maximum width in image pixels.

minimum1
never_require_signed_urls: Optional[bool]

Indicates whether the variant can access an image without a signature, regardless of image access control.

class VariantCreateResponse:
variant: Optional[Variant]
id: str
maxLength99
options: VariantOptions

Allows you to define image resizing sizes for different use cases.

fit: Literal["scale-down", "contain", "cover", 2 more]

The fit property describes how the width and height dimensions should be interpreted.

One of the following:
"scale-down"
"contain"
"cover"
"crop"
"pad"
height: float

Maximum height in image pixels.

minimum1
metadata: Literal["keep", "copyright", "none"]

What EXIF data should be preserved in the output image.

One of the following:
"keep"
"copyright"
"none"
width: float

Maximum width in image pixels.

minimum1
never_require_signed_urls: Optional[bool]

Indicates whether the variant can access an image without a signature, regardless of image access control.

class VariantEditResponse:
variant: Optional[Variant]
id: str
maxLength99
options: VariantOptions

Allows you to define image resizing sizes for different use cases.

fit: Literal["scale-down", "contain", "cover", 2 more]

The fit property describes how the width and height dimensions should be interpreted.

One of the following:
"scale-down"
"contain"
"cover"
"crop"
"pad"
height: float

Maximum height in image pixels.

minimum1
metadata: Literal["keep", "copyright", "none"]

What EXIF data should be preserved in the output image.

One of the following:
"keep"
"copyright"
"none"
width: float

Maximum width in image pixels.

minimum1
never_require_signed_urls: Optional[bool]

Indicates whether the variant can access an image without a signature, regardless of image access control.

Union[str, object]
One of the following:
str
object

ImagesV1Blobs

Base image
images.v1.blobs.get(strimage_id, BlobGetParams**kwargs) -> BinaryResponseContent
GET/accounts/{account_id}/images/v1/{image_id}/blob

ImagesV2

List images V2
images.v2.list(V2ListParams**kwargs) -> V2ListResponse
GET/accounts/{account_id}/images/v2
ModelsExpand Collapse
class V2ListResponse:
continuation_token: Optional[str]

Continuation token to fetch next page. Passed as a query param when requesting List V2 api endpoint.

maxLength32
images: Optional[List[Image]]
id: Optional[str]

Image unique identifier.

maxLength32
creator: Optional[str]

Can set the creator field with an internal user ID.

maxLength1024
filename: Optional[str]

Image file name.

maxLength255
meta: Optional[object]

User modifiable key-value store. Can be used for keeping references to another system of record for managing images. Metadata must not exceed 1024 bytes.

require_signed_urls: Optional[bool]

Indicates whether the image can be a accessed only using it's UID. If set to true, a signed token needs to be generated with a signing key to view the image.

uploaded: Optional[datetime]

When the media item was uploaded.

formatdate-time
variants: Optional[List[str]]

Object specifying available variants for an image.

ImagesV2Direct Uploads

Create authenticated direct upload URL V2
images.v2.direct_uploads.create(DirectUploadCreateParams**kwargs) -> DirectUploadCreateResponse
POST/accounts/{account_id}/images/v2/direct_upload
ModelsExpand Collapse
class DirectUploadCreateResponse:
id: Optional[str]

Image unique identifier.

maxLength32
upload_url: Optional[str]

The URL the unauthenticated upload can be performed to using a single HTTP POST (multipart/form-data) request.