---
title: Images
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Images

#### ImagesV1

##### [List images](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/methods/list)

Deprecated

client.Images.V1.List(ctx, params) (\*V4PagePagination\[[V1ListResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1%20%3E%20(model)%20V1ListResponse%20%3E%20(schema)>)], error)

GET/accounts/{account\_id}/images/v1

##### [Image details](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/methods/get)

client.Images.V1.Get(ctx, imageID, query) (\*[Image](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/images/v1/{image\_id}

##### [Upload an image](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/methods/create)

client.Images.V1.New(ctx, params) (\*[Image](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/images/v1

##### [Update image](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/methods/edit)

client.Images.V1.Edit(ctx, imageID, params) (\*[Image](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)>), error)

PATCH/accounts/{account\_id}/images/v1/{image\_id}

##### [Delete image](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/methods/delete)

client.Images.V1.Delete(ctx, imageID, body) (\*unknown, error)

DELETE/accounts/{account\_id}/images/v1/{image\_id}

##### ModelsExpand Collapse

<details>

<summary>

type Image struct{…}

</summary>

ID stringOptional

Image unique identifier.

maxLength32

<a href="#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Creator stringOptional

Can set the creator field with an internal user ID.

maxLength1024

<a href="#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)%20%3E%20(property)%20creator">Link to this property</a>

Filename stringOptional

Image file name.

maxLength255

<a href="#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)%20%3E%20(property)%20filename">Link to this property</a>

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.

<a href="#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)%20%3E%20(property)%20meta">Link to this property</a>

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.

<a href="#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)%20%3E%20(property)%20requireSignedURLs">Link to this property</a>

Uploaded TimeOptional

When the media item was uploaded.

formatdate-time

<a href="#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)%20%3E%20(property)%20uploaded">Link to this property</a>

Variants \[]stringOptional

Object specifying available variants for an image.

<a href="#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)%20%3E%20(property)%20variants">Link to this property</a>

</details>

[Link to this property](<#(resource)%20images.v1%20%3E%20(model)%20image%20%3E%20(schema)>)

#### ImagesV1Keys

##### [List Signing Keys](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/keys/methods/list)

client.Images.V1.Keys.List(ctx, query) (\*[V1KeyListResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.keys%20%3E%20(model)%20V1KeyListResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/images/v1/keys

##### [Create a new Signing Key](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/keys/methods/update)

client.Images.V1.Keys.Update(ctx, signingKeyName, body) (\*[V1KeyUpdateResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.keys%20%3E%20(model)%20V1KeyUpdateResponse%20%3E%20(schema)>), error)

PUT/accounts/{account\_id}/images/v1/keys/{signing\_key\_name}

##### [Delete Signing Key](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/keys/methods/delete)

client.Images.V1.Keys.Delete(ctx, signingKeyName, body) (\*[V1KeyDeleteResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.keys%20%3E%20(model)%20V1KeyDeleteResponse%20%3E%20(schema)>), error)

DELETE/accounts/{account\_id}/images/v1/keys/{signing\_key\_name}

##### ModelsExpand Collapse

<details>

<summary>

type Key struct{…}

</summary>

Name stringOptional

Key name.

<a href="#(resource)%20images.v1.keys%20%3E%20(model)%20key%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

Value stringOptional

Key value.

<a href="#(resource)%20images.v1.keys%20%3E%20(model)%20key%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20images.v1.keys%20%3E%20(model)%20key%20%3E%20(schema)>)

#### ImagesV1Stats

##### [Images usage statistics](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/stats/methods/get)

client.Images.V1.Stats.Get(ctx, query) (\*[Stat](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.stats%20%3E%20(model)%20stat%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/images/v1/stats

##### ModelsExpand Collapse

<details>

<summary>

type Stat struct{…}

</summary>

<details>

<summary>

Count StatCountOptional

</summary>

Allowed float64Optional

Cloudflare Images allowed usage.

<a href="#(resource)%20images.v1.stats%20%3E%20(model)%20stat%20%3E%20(schema)%20%3E%20(property)%20count%20%3E%20(property)%20allowed">Link to this property</a>

Current float64Optional

Cloudflare Images current usage.

<a href="#(resource)%20images.v1.stats%20%3E%20(model)%20stat%20%3E%20(schema)%20%3E%20(property)%20count%20%3E%20(property)%20current">Link to this property</a>

</details>

<a href="#(resource)%20images.v1.stats%20%3E%20(model)%20stat%20%3E%20(schema)%20%3E%20(property)%20count">Link to this property</a>

</details>

[Link to this property](<#(resource)%20images.v1.stats%20%3E%20(model)%20stat%20%3E%20(schema)>)

#### ImagesV1Variants

##### [List variants](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/variants/methods/list)

client.Images.V1.Variants.List(ctx, query) (\*[Variant](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/images/v1/variants

##### [Variant details](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/variants/methods/get)

client.Images.V1.Variants.Get(ctx, variantID, query) (\*[V1VariantGetResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.variants%20%3E%20(model)%20V1VariantGetResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/images/v1/variants/{variant\_id}

##### [Create a variant](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/variants/methods/create)

client.Images.V1.Variants.New(ctx, params) (\*[V1VariantNewResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.variants%20%3E%20(model)%20V1VariantNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/images/v1/variants

##### [Update a variant](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/variants/methods/edit)

client.Images.V1.Variants.Edit(ctx, variantID, params) (\*[V1VariantEditResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v1.variants%20%3E%20(model)%20V1VariantEditResponse%20%3E%20(schema)>), error)

PATCH/accounts/{account\_id}/images/v1/variants/{variant\_id}

##### [Delete a variant](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/variants/methods/delete)

client.Images.V1.Variants.Delete(ctx, variantID, body) (\*unknown, error)

DELETE/accounts/{account\_id}/images/v1/variants/{variant\_id}

##### ModelsExpand Collapse

<details>

<summary>

type Variant struct{…}

</summary>

<details>

<summary>

Variants VariantVariantsOptional

</summary>

<details>

<summary>

Hero VariantVariantsHeroOptional

</summary>

ID string

maxLength99

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20id">Link to this property</a>

<details>

<summary>

Options VariantVariantsHeroOptions

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

</summary>

<details>

<summary>

Fit VariantVariantsHeroOptionsFit

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

</summary>

One of the following:

const VariantVariantsHeroOptionsFitScaleDown VariantVariantsHeroOptionsFit = "scale-down"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20fit%20%3E%20(member)%200">Link to this property</a>

const VariantVariantsHeroOptionsFitContain VariantVariantsHeroOptionsFit = "contain"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20fit%20%3E%20(member)%201">Link to this property</a>

const VariantVariantsHeroOptionsFitCover VariantVariantsHeroOptionsFit = "cover"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20fit%20%3E%20(member)%202">Link to this property</a>

const VariantVariantsHeroOptionsFitCrop VariantVariantsHeroOptionsFit = "crop"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20fit%20%3E%20(member)%203">Link to this property</a>

const VariantVariantsHeroOptionsFitPad VariantVariantsHeroOptionsFit = "pad"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20fit%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20fit">Link to this property</a>

Height float64

Maximum height in image pixels.

minimum1

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20height">Link to this property</a>

<details>

<summary>

Metadata VariantVariantsHeroOptionsMetadata

What EXIF data should be preserved in the output image.

</summary>

One of the following:

const VariantVariantsHeroOptionsMetadataKeep VariantVariantsHeroOptionsMetadata = "keep"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20metadata%20%3E%20(member)%200">Link to this property</a>

const VariantVariantsHeroOptionsMetadataCopyright VariantVariantsHeroOptionsMetadata = "copyright"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20metadata%20%3E%20(member)%201">Link to this property</a>

const VariantVariantsHeroOptionsMetadataNone VariantVariantsHeroOptionsMetadata = "none"

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20metadata%20%3E%20(member)%202">Link to this property</a>

</details>

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20metadata">Link to this property</a>

Width float64

Maximum width in image pixels.

minimum1

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options%20%3E%20(property)%20width">Link to this property</a>

</details>

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20options">Link to this property</a>

NeverRequireSignedURLs boolOptional

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

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero%20%3E%20(property)%20neverRequireSignedURLs">Link to this property</a>

</details>

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants%20%3E%20(property)%20hero">Link to this property</a>

</details>

<a href="#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)%20%3E%20(property)%20variants">Link to this property</a>

</details>

[Link to this property](<#(resource)%20images.v1.variants%20%3E%20(model)%20variant%20%3E%20(schema)>)

#### ImagesV1Blobs

##### [Download image](https://developers.cloudflare.com/api/go/resources/images/subresources/v1/subresources/blobs/methods/get)

client.Images.V1.Blobs.Get(ctx, imageID, query) (\*Response, error)

GET/accounts/{account\_id}/images/v1/{image\_id}/blob

#### ImagesV2

##### [List images V2](https://developers.cloudflare.com/api/go/resources/images/subresources/v2/methods/list)

client.Images.V2.List(ctx, params) (\*[V2ListResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v2%20%3E%20(model)%20V2ListResponse%20%3E%20(schema)>), error)

GET/accounts/{account\_id}/images/v2

#### ImagesV2Direct Uploads

##### [Create authenticated direct upload URL V2](https://developers.cloudflare.com/api/go/resources/images/subresources/v2/subresources/direct_uploads/methods/create)

client.Images.V2.DirectUploads.New(ctx, params) (\*[V2DirectUploadNewResponse](<https://developers.cloudflare.com/api/go/resources/images#(resource)%20images.v2.direct_uploads%20%3E%20(model)%20V2DirectUploadNewResponse%20%3E%20(schema)>), error)

POST/accounts/{account\_id}/images/v2/direct\_upload