---
title: Create Smart Tiered Cache setting
---

[Skip to content](#_top)

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

[Cache](https://developers.cloudflare.com/api/go/resources/cache)

[Smart Tiered Cache](https://developers.cloudflare.com/api/go/resources/cache/subresources/smart_tiered_cache)

Copy Markdown

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

---

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

# Create Smart Tiered Cache setting

client.Cache.SmartTieredCache.New(ctx, params) (\*[SmartTieredCacheNewResponse](<https://developers.cloudflare.com/api/go/resources/cache#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)>), error)

POST/zones/{zone\_id}/cache/tiered\_cache\_smart\_topology\_enable

Smart Tiered Cache dynamically selects the single closest upper tier for each of your website’s origins with no configuration required, using our in-house performance and routing data. Cloudflare collects latency data for each request to an origin, and uses the latency data to determine how well any upper-tier data center is connected with an origin. As a result, Cloudflare can select the data center with the lowest latency to be the upper-tier for an origin.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

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

`Zone Settings Write``Zone Write`

##### ParametersExpand Collapse

<details>

<summary>

params SmartTieredCacheNewParams

</summary>

ZoneID param.Field\[string]

Path param: Identifier.

maxLength32

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

<details>

<summary>

Value param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/cache/subresources/smart_tiered_cache/methods/create#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20value%20%3E%20(schema)">SmartTieredCacheNewParamsValue</a>]

Body param: Enable or disable the Smart Tiered Cache.

</summary>

const SmartTieredCacheNewParamsValueOn <a href="https://developers.cloudflare.com/api/go/resources/cache/subresources/smart_tiered_cache/methods/create#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20value%20%3E%20(schema)">SmartTieredCacheNewParamsValue</a> = "on"

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20value%20%3E%20(schema)%20%3E%20(member)%200">Link to this property</a>

const SmartTieredCacheNewParamsValueOff <a href="https://developers.cloudflare.com/api/go/resources/cache/subresources/smart_tiered_cache/methods/create#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20value%20%3E%20(schema)">SmartTieredCacheNewParamsValue</a> = "off"

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20value%20%3E%20(schema)%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default%20%3E%20(param)%20value">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(method)%20create%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type SmartTieredCacheNewResponse struct{…}

</summary>

ID SmartTieredCacheNewResponseID

The identifier of the caching setting.

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Editable bool

Whether the setting is editable.

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)%20%3E%20(property)%20editable">Link to this property</a>

<details>

<summary>

Value SmartTieredCacheNewResponseValue

Value of the Smart Tiered Cache zone setting.

</summary>

One of the following:

const SmartTieredCacheNewResponseValueOn SmartTieredCacheNewResponseValue = "on"

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)%20%3E%20(property)%20value%20%3E%20(member)%200">Link to this property</a>

const SmartTieredCacheNewResponseValueOff SmartTieredCacheNewResponseValue = "off"

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)%20%3E%20(property)%20value%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)%20%3E%20(property)%20value">Link to this property</a>

ModifiedOn TimeOptional

Last time this setting was modified.

formatdate-time

<a href="#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)%20%3E%20(property)%20modified_on">Link to this property</a>

</details>

[Link to this property](<#(resource)%20cache.smart_tiered_cache%20%3E%20(model)%20SmartTieredCacheNewResponse%20%3E%20(schema)>)

### Create Smart Tiered Cache setting

Go

HTTPTypeScriptPythonGoTerraform

```
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"),
  )
  smartTieredCache, err := client.Cache.SmartTieredCache.New(context.TODO(), cache.SmartTieredCacheNewParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    Value: cloudflare.F(cache.SmartTieredCacheNewParamsValueOn),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", smartTieredCache.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": "tiered_cache_smart_topology_enable",
    "editable": true,
    "value": "on",
    "modified_on": "2014-01-01T05:20:00.12345Z"
  }
}
```

##### 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": "tiered_cache_smart_topology_enable",
    "editable": true,
    "value": "on",
    "modified_on": "2014-01-01T05:20:00.12345Z"
  }
}
```