---
title: Change Image Transformations Allowed Origins setting
---

[Skip to content](#%5Ftop) 

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

[Zones](https://developers.cloudflare.com/api/go/resources/zones)

[Transformations Allowed Origins](https://developers.cloudflare.com/api/go/resources/zones/subresources/transformations%5Fallowed%5Forigins)

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Change Image Transformations Allowed Origins setting

client.Zones.TransformationsAllowedOrigins.Edit(ctx, params) (\*[TransformationsAllowedOrigins](https://developers.cloudflare.com/api/go/resources/zones#%28resource%29%20zones.transformations%5Fallowed%5Forigins%20%3E%20%28model%29%20transformations%5Fallowed%5Forigins%20%3E%20%28schema%29), error)

PATCH/zones/{zone\_id}/settings/transformations\_allowed\_origins

Media Transformations Allowed Origins restricts transformations for images and video served through Cloudflare’s network to requests originating from specified domains. Refer to the Image Transformations and Video Transformations documentation for more information.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/).

**Example:**`Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY`

API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

**Example:**`X-Auth-Email: user@example.com`

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

**Example:**`X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194`

##### Accepted Permissions (at least one required)

`Zone Settings Write`

##### ParametersExpand Collapse 

params TransformationsAllowedOriginEditParams

ZoneID param.Field\[string\]

Path param: Identifier.

maxLength32

Value param.Field\[string\]

Body param: Comma-separated list of allowed origin domains for image and video transformations. Use ”\*” to allow all origins (default).

##### ReturnsExpand Collapse 

type TransformationsAllowedOrigins struct{…}

Controls which origins are allowed to request image and video transformations.

ID TransformationsAllowedOriginsIDOptional

ID of the zone setting.

Editable TransformationsAllowedOriginsEditableOptional

Whether or not this setting can be modified for this zone (based on your Cloudflare plan level).

One of the following:

const TransformationsAllowedOriginsEditableTrue TransformationsAllowedOriginsEditable \= true

const TransformationsAllowedOriginsEditableFalse TransformationsAllowedOriginsEditable \= false

ModifiedOn TimeOptional

last time this setting was modified.

formatdate-time

Value TransformationsAllowedOriginsValueOptional

Comma-separated list of allowed origin domains for image and video transformations. Use ”\*” to allow all origins (default).

One of the following:

const TransformationsAllowedOriginsValueOn TransformationsAllowedOriginsValue \= "on"

const TransformationsAllowedOriginsValueOff TransformationsAllowedOriginsValue \= "off"

### Change Image Transformations Allowed Origins setting

Go

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/zones"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  transformationsAllowedOrigins, err := client.Zones.TransformationsAllowedOrigins.Edit(context.TODO(), zones.TransformationsAllowedOriginEditParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    Value: cloudflare.F("example.com,cdn.example.com"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", transformationsAllowedOrigins.ID)
}

```

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "image_resizing_allowed_origins",
    "editable": true,
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "value": "on"
  }
}
```

##### Returns Examples

200 example

```
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "success": true,
  "result": {
    "id": "image_resizing_allowed_origins",
    "editable": true,
    "modified_on": "2014-01-01T05:20:00.12345Z",
    "value": "on"
  }
}
```