---
title: Update a namespace
---

[Skip to content](#_top)

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

[AI Search](https://developers.cloudflare.com/api/go/resources/ai_search)

[Namespaces](https://developers.cloudflare.com/api/go/resources/ai_search/subresources/namespaces)

Copy Markdown

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

---

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

# Update a namespace

client.AISearch.Namespaces.Update(ctx, name, params) (\*[NamespaceUpdateResponse](<https://developers.cloudflare.com/api/go/resources/ai_search#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)>), error)

PUT/accounts/{account\_id}/ai-search/namespaces/{name}

Update the description and/or the public endpoint configuration of an existing namespace. The default namespace’s description cannot be modified, but its public endpoint can.

##### 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>

##### ParametersExpand Collapse

name string

[Link to this property](<#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20name%20%3E%20(schema)>)

<details>

<summary>

params NamespaceUpdateParams

</summary>

AccountID param.Field\[string]

Path param

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20account_id">Link to this property</a>

Description param.Field\[string]Optional

Body param: Optional description for the namespace. Max 256 characters.

maxLength256

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20description">Link to this property</a>

<details>

<summary>

PublicEndpointParams param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/ai_search/subresources/namespaces/methods/update#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)">NamespaceUpdateParamsPublicEndpointParams</a>]Optional

Body param

</summary>

AuthorizedHosts \[]stringOptional

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20authorized_hosts">Link to this property</a>

<details>

<summary>

ChatCompletionsEndpoint NamespaceUpdateParamsPublicEndpointParamsChatCompletionsEndpointOptional

</summary>

Disabled boolOptional

Disable chat completions endpoint for this public endpoint

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20chat_completions_endpoint%20%3E%20(property)%20disabled">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20chat_completions_endpoint">Link to this property</a>

CustomDomains \[]stringOptional

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20custom_domains">Link to this property</a>

DefaultDomainEnabled boolOptional

When false, the instance is reachable only via a registered custom domain and the default &lt;public\_endpoint\_id&gt;.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public\_endpoint\_params is replaced wholesale on update, so resend default\_domain\_enabled on every update to keep the default host off — omitting it resets to true.

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20default_domain_enabled">Link to this property</a>

Enabled boolOptional

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20enabled">Link to this property</a>

InstancesAllowed \[]stringOptional

Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account’s multi-instance search limit.

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20instances_allowed">Link to this property</a>

<details>

<summary>

Mcp NamespaceUpdateParamsPublicEndpointParamsMcpOptional

</summary>

Description stringOptional

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20mcp%20%3E%20(property)%20description">Link to this property</a>

Disabled boolOptional

Disable MCP endpoint for this public endpoint

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20mcp%20%3E%20(property)%20disabled">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20mcp">Link to this property</a>

<details>

<summary>

RateLimit NamespaceUpdateParamsPublicEndpointParamsRateLimitOptional

</summary>

PeriodMs int64Optional

maximum3600000

minimum60000

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20rate_limit%20%3E%20(property)%20period_ms">Link to this property</a>

Requests int64Optional

minimum1

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20rate_limit%20%3E%20(property)%20requests">Link to this property</a>

<details>

<summary>

Technique NamespaceUpdateParamsPublicEndpointParamsRateLimitTechniqueOptional

</summary>

One of the following:

const NamespaceUpdateParamsPublicEndpointParamsRateLimitTechniqueFixed NamespaceUpdateParamsPublicEndpointParamsRateLimitTechnique = "fixed"

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20rate_limit%20%3E%20(property)%20technique%20%3E%20(member)%200">Link to this property</a>

const NamespaceUpdateParamsPublicEndpointParamsRateLimitTechniqueSliding NamespaceUpdateParamsPublicEndpointParamsRateLimitTechnique = "sliding"

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20rate_limit%20%3E%20(property)%20technique%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20rate_limit%20%3E%20(property)%20technique">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20rate_limit">Link to this property</a>

<details>

<summary>

SearchEndpoint NamespaceUpdateParamsPublicEndpointParamsSearchEndpointOptional

</summary>

Disabled boolOptional

Disable search endpoint for this public endpoint

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20search_endpoint%20%3E%20(property)%20disabled">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params%20%3E%20(schema)%20%3E%20(property)%20search_endpoint">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20public_endpoint_params">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_search.namespaces%20%3E%20(method)%20update%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type NamespaceUpdateResponse struct{…}

</summary>

CreatedAt Time

formatdate-time

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20created_at">Link to this property</a>

Name string

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20name">Link to this property</a>

Description stringOptional

Optional description for the namespace. Max 256 characters.

maxLength256

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20description">Link to this property</a>

PublicEndpointID stringOptional

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_id">Link to this property</a>

<details>

<summary>

PublicEndpointParams NamespaceUpdateResponsePublicEndpointParamsOptional

</summary>

AuthorizedHosts \[]stringOptional

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20authorized_hosts">Link to this property</a>

<details>

<summary>

ChatCompletionsEndpoint NamespaceUpdateResponsePublicEndpointParamsChatCompletionsEndpointOptional

</summary>

Disabled boolOptional

Disable chat completions endpoint for this public endpoint

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20chat_completions_endpoint%20%3E%20(property)%20disabled">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20chat_completions_endpoint">Link to this property</a>

CustomDomains \[]stringOptional

Custom domain hostnames that alias this public endpoint. GET and create responses return the current set; on update (PUT) this field is only echoed back when supplied in the request body, otherwise it is null (omit it to leave domains unchanged).

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20custom_domains">Link to this property</a>

DefaultDomainEnabled boolOptional

When false, the instance is reachable only via a registered custom domain and the default &lt;public\_endpoint\_id&gt;.search.ai.cloudflare.com host returns 404. Requires at least one custom domain. Defaults to true. public\_endpoint\_params is replaced wholesale on update, so resend default\_domain\_enabled on every update to keep the default host off — omitting it resets to true.

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20default_domain_enabled">Link to this property</a>

Enabled boolOptional

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20enabled">Link to this property</a>

InstancesAllowed \[]stringOptional

Instance IDs exposed through the namespace public endpoint. Empty means nothing is searchable. Every ID must be an existing instance in this namespace, and the list cannot exceed the account’s multi-instance search limit.

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20instances_allowed">Link to this property</a>

<details>

<summary>

Mcp NamespaceUpdateResponsePublicEndpointParamsMcpOptional

</summary>

Description stringOptional

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20mcp%20%3E%20(property)%20description">Link to this property</a>

Disabled boolOptional

Disable MCP endpoint for this public endpoint

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20mcp%20%3E%20(property)%20disabled">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20mcp">Link to this property</a>

<details>

<summary>

RateLimit NamespaceUpdateResponsePublicEndpointParamsRateLimitOptional

</summary>

PeriodMs int64Optional

maximum3600000

minimum60000

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20rate_limit%20%3E%20(property)%20period_ms">Link to this property</a>

Requests int64Optional

minimum1

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20rate_limit%20%3E%20(property)%20requests">Link to this property</a>

<details>

<summary>

Technique NamespaceUpdateResponsePublicEndpointParamsRateLimitTechniqueOptional

</summary>

One of the following:

const NamespaceUpdateResponsePublicEndpointParamsRateLimitTechniqueFixed NamespaceUpdateResponsePublicEndpointParamsRateLimitTechnique = "fixed"

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20rate_limit%20%3E%20(property)%20technique%20%3E%20(member)%200">Link to this property</a>

const NamespaceUpdateResponsePublicEndpointParamsRateLimitTechniqueSliding NamespaceUpdateResponsePublicEndpointParamsRateLimitTechnique = "sliding"

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20rate_limit%20%3E%20(property)%20technique%20%3E%20(member)%201">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20rate_limit%20%3E%20(property)%20technique">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20rate_limit">Link to this property</a>

<details>

<summary>

SearchEndpoint NamespaceUpdateResponsePublicEndpointParamsSearchEndpointOptional

</summary>

Disabled boolOptional

Disable search endpoint for this public endpoint

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20search_endpoint%20%3E%20(property)%20disabled">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params%20%3E%20(property)%20search_endpoint">Link to this property</a>

</details>

<a href="#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20public_endpoint_params">Link to this property</a>

</details>

[Link to this property](<#(resource)%20ai_search.namespaces%20%3E%20(model)%20NamespaceUpdateResponse%20%3E%20(schema)>)

### Update a namespace

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  namespace, err := client.AISearch.Namespaces.Update(
    context.TODO(),
    "production",
    ai_search.NamespaceUpdateParams{
      AccountID: cloudflare.F("c3dc5f0b34a14ff8e1b3ec04895e1b22"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", namespace.PublicEndpointID)
}
```

200 example

```
{
  "result": {
    "created_at": "2019-12-27T18:11:19.117Z",
    "name": "production",
    "description": "Production environment",
    "public_endpoint_id": "public_endpoint_id",
    "public_endpoint_params": {
      "authorized_hosts": [
        "string"
      ],
      "chat_completions_endpoint": {
        "disabled": true
      },
      "custom_domains": [
        "search.example.com"
      ],
      "default_domain_enabled": true,
      "enabled": true,
      "instances_allowed": [
        "docs",
        "blog"
      ],
      "mcp": {
        "description": "description",
        "disabled": true
      },
      "rate_limit": {
        "period_ms": 60000,
        "requests": 1,
        "technique": "fixed"
      },
      "search_endpoint": {
        "disabled": true
      }
    }
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "result": {
    "created_at": "2019-12-27T18:11:19.117Z",
    "name": "production",
    "description": "Production environment",
    "public_endpoint_id": "public_endpoint_id",
    "public_endpoint_params": {
      "authorized_hosts": [
        "string"
      ],
      "chat_completions_endpoint": {
        "disabled": true
      },
      "custom_domains": [
        "search.example.com"
      ],
      "default_domain_enabled": true,
      "enabled": true,
      "instances_allowed": [
        "docs",
        "blog"
      ],
      "mcp": {
        "description": "description",
        "disabled": true
      },
      "rate_limit": {
        "period_ms": 60000,
        "requests": 1,
        "technique": "fixed"
      },
      "search_endpoint": {
        "disabled": true
      }
    }
  },
  "success": true
}
```