## Create or replace an origin cloud region mapping `client.Cache.OriginCloudRegions.Update(ctx, originIP, params) (*OriginCloudRegion, error)` **put** `/zones/{zone_id}/origin/cloud_regions/{origin_ip}` Creates a new IP-to-cloud-region mapping or replaces the existing mapping for the specified IP. PUT is idempotent — calling it repeatedly with the same body produces the same result. The IP path parameter is normalized to canonical form (RFC 5952 for IPv6) before storage. The vendor and region are validated against the list from `GET /zones/{zone_id}/origin/cloud_regions/supported_regions`. Returns 400 if the `origin_ip` in the body does not match the URL path parameter. Returns 403 (code 1164) when the zone has reached the limit of 3,500 IP mappings. ### Parameters - `originIP string` - `params OriginCloudRegionUpdateParams` - `ZoneID param.Field[string]` Path param: Identifier. - `OriginIP param.Field[string]` Body param: Origin IP address (IPv4 or IPv6). For the single PUT endpoint (`PUT /origin/cloud_regions/{origin_ip}`), this field must match the path parameter or the request will be rejected with a 400 error. For the batch PUT endpoint, this field identifies which mapping to upsert. - `Region param.Field[string]` Body param: Cloud vendor region identifier. Must be a valid region for the specified vendor as returned by the supported_regions endpoint. - `Vendor param.Field[OriginCloudRegionUpdateParamsVendor]` Body param: Cloud vendor hosting the origin. Must be one of the supported vendors. - `const OriginCloudRegionUpdateParamsVendorAws OriginCloudRegionUpdateParamsVendor = "aws"` - `const OriginCloudRegionUpdateParamsVendorAzure OriginCloudRegionUpdateParamsVendor = "azure"` - `const OriginCloudRegionUpdateParamsVendorGcp OriginCloudRegionUpdateParamsVendor = "gcp"` - `const OriginCloudRegionUpdateParamsVendorOci OriginCloudRegionUpdateParamsVendor = "oci"` ### Returns - `type OriginCloudRegion struct{…}` A single origin IP-to-cloud-region mapping. - `OriginIP string` The origin IP address (IPv4 or IPv6). Normalized to canonical form (RFC 5952 for IPv6). - `Region string` Cloud vendor region identifier. - `Vendor OriginCloudRegionVendor` Cloud vendor hosting the origin. - `const OriginCloudRegionVendorAws OriginCloudRegionVendor = "aws"` - `const OriginCloudRegionVendorAzure OriginCloudRegionVendor = "azure"` - `const OriginCloudRegionVendorGcp OriginCloudRegionVendor = "gcp"` - `const OriginCloudRegionVendorOci OriginCloudRegionVendor = "oci"` - `ModifiedOn Time` Time this mapping was last modified. ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/cache" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) originCloudRegion, err := client.Cache.OriginCloudRegions.Update( context.TODO(), "192.0.2.1", cache.OriginCloudRegionUpdateParams{ ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), OriginIP: cloudflare.F("192.0.2.1"), Region: cloudflare.F("us-east-1"), Vendor: cloudflare.F(cache.OriginCloudRegionUpdateParamsVendorAws), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", originCloudRegion.OriginIP) } ``` #### Response ```json { "errors": [], "messages": [], "result": { "modified_on": "2026-03-01T12:00:00Z", "origin_ip": "192.0.2.1", "region": "us-east-1", "vendor": "aws" }, "success": true } ```