Skip to content
Start here

Images

ImagesV1

List images
Deprecated
client.Images.V1.List(ctx, params) (*V4PagePagination[V1ListResponse], error)
GET/accounts/{account_id}/images/v1
Image details
client.Images.V1.Get(ctx, imageID, query) (*Image, error)
GET/accounts/{account_id}/images/v1/{image_id}
Upload an image
client.Images.V1.New(ctx, params) (*Image, error)
POST/accounts/{account_id}/images/v1
Update image
client.Images.V1.Edit(ctx, imageID, params) (*Image, error)
PATCH/accounts/{account_id}/images/v1/{image_id}
Delete image
client.Images.V1.Delete(ctx, imageID, body) (*unknown, error)
DELETE/accounts/{account_id}/images/v1/{image_id}
ModelsExpand Collapse
type Image struct{…}
ID stringoptional

Image unique identifier.

maxLength32
Creator stringoptional

Can set the creator field with an internal user ID.

maxLength1024
Filename stringoptional

Image file name.

maxLength255
Meta unknownoptional

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.

RequireSignedURLs booloptional

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 Timeoptional

When the media item was uploaded.

formatdate-time
Variants []stringoptional

Object specifying available variants for an image.

ImagesV1Keys

List Signing Keys
client.Images.V1.Keys.List(ctx, query) (*V1KeyListResponse, error)
GET/accounts/{account_id}/images/v1/keys
Create a new Signing Key
client.Images.V1.Keys.Update(ctx, signingKeyName, body) (*V1KeyUpdateResponse, error)
PUT/accounts/{account_id}/images/v1/keys/{signing_key_name}
Delete Signing Key
client.Images.V1.Keys.Delete(ctx, signingKeyName, body) (*V1KeyDeleteResponse, error)
DELETE/accounts/{account_id}/images/v1/keys/{signing_key_name}
ModelsExpand Collapse
type Key struct{…}
Name stringoptional

Key name.

Value stringoptional

Key value.

ImagesV1Stats

Images usage statistics
client.Images.V1.Stats.Get(ctx, query) (*Stat, error)
GET/accounts/{account_id}/images/v1/stats
ModelsExpand Collapse
type Stat struct{…}
Count StatCountoptional
Allowed float64optional

Cloudflare Images allowed usage.

Current float64optional

Cloudflare Images current usage.

ImagesV1Variants

List variants
client.Images.V1.Variants.List(ctx, query) (*Variant, error)
GET/accounts/{account_id}/images/v1/variants
Variant details
client.Images.V1.Variants.Get(ctx, variantID, query) (*V1VariantGetResponse, error)
GET/accounts/{account_id}/images/v1/variants/{variant_id}
Create a variant
client.Images.V1.Variants.New(ctx, params) (*V1VariantNewResponse, error)
POST/accounts/{account_id}/images/v1/variants
Update a variant
client.Images.V1.Variants.Edit(ctx, variantID, params) (*V1VariantEditResponse, error)
PATCH/accounts/{account_id}/images/v1/variants/{variant_id}
Delete a variant
client.Images.V1.Variants.Delete(ctx, variantID, body) (*unknown, error)
DELETE/accounts/{account_id}/images/v1/variants/{variant_id}
ModelsExpand Collapse
type Variant struct{…}
Variants VariantVariantsoptional
Hero VariantVariantsHerooptional
ID string
maxLength99
Options VariantVariantsHeroOptions

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

Fit VariantVariantsHeroOptionsFit

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

One of the following:
const VariantVariantsHeroOptionsFitScaleDown VariantVariantsHeroOptionsFit = "scale-down"
const VariantVariantsHeroOptionsFitContain VariantVariantsHeroOptionsFit = "contain"
const VariantVariantsHeroOptionsFitCover VariantVariantsHeroOptionsFit = "cover"
const VariantVariantsHeroOptionsFitCrop VariantVariantsHeroOptionsFit = "crop"
const VariantVariantsHeroOptionsFitPad VariantVariantsHeroOptionsFit = "pad"
Height float64

Maximum height in image pixels.

minimum1
Metadata VariantVariantsHeroOptionsMetadata

What EXIF data should be preserved in the output image.

One of the following:
const VariantVariantsHeroOptionsMetadataKeep VariantVariantsHeroOptionsMetadata = "keep"
const VariantVariantsHeroOptionsMetadataCopyright VariantVariantsHeroOptionsMetadata = "copyright"
const VariantVariantsHeroOptionsMetadataNone VariantVariantsHeroOptionsMetadata = "none"
Width float64

Maximum width in image pixels.

minimum1
NeverRequireSignedURLs booloptional

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

ImagesV1Blobs

Base image
client.Images.V1.Blobs.Get(ctx, imageID, query) (*Response, error)
GET/accounts/{account_id}/images/v1/{image_id}/blob

ImagesV2

List images V2
client.Images.V2.List(ctx, params) (*V2ListResponse, error)
GET/accounts/{account_id}/images/v2

ImagesV2Direct Uploads

Create authenticated direct upload URL V2
client.Images.V2.DirectUploads.New(ctx, params) (*V2DirectUploadNewResponse, error)
POST/accounts/{account_id}/images/v2/direct_upload