Skip to content
Start here

Update an AI Search instance.

client.AISearch.Instances.Update(ctx, id, params) (*InstanceUpdateResponse, error)
PUT/accounts/{account_id}/ai-search/instances/{id}

Update the configuration of an AI Search instance.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a 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
ParametersExpand Collapse
id string
params InstanceUpdateParams
AccountID param.Field[string]

Path param

AIGatewayID param.Field[string]Optional

Body param

AISearchModel param.Field[InstanceUpdateParamsAISearchModel]Optional

Body param

const InstanceUpdateParamsAISearchModelCfMetaLlama3_3_70bInstructFp8Fast InstanceUpdateParamsAISearchModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceUpdateParamsAISearchModelCfZaiOrgGlm4_7Flash InstanceUpdateParamsAISearchModel = "@cf/zai-org/glm-4.7-flash"
const InstanceUpdateParamsAISearchModelCfMetaLlama3_1_8bInstructFast InstanceUpdateParamsAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceUpdateParamsAISearchModelCfMetaLlama3_1_8bInstructFp8 InstanceUpdateParamsAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceUpdateParamsAISearchModelCfMetaLlama4Scout17b16eInstruct InstanceUpdateParamsAISearchModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceUpdateParamsAISearchModelCfQwenQwen3_30bA3bFp8 InstanceUpdateParamsAISearchModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceUpdateParamsAISearchModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceUpdateParamsAISearchModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceUpdateParamsAISearchModelCfMoonshotaiKimiK2Instruct InstanceUpdateParamsAISearchModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceUpdateParamsAISearchModelCfGoogleGemma3_12bIt InstanceUpdateParamsAISearchModel = "@cf/google/gemma-3-12b-it"
const InstanceUpdateParamsAISearchModelCfGoogleGemma4_26bA4bIt InstanceUpdateParamsAISearchModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceUpdateParamsAISearchModelCfMoonshotaiKimiK2_5 InstanceUpdateParamsAISearchModel = "@cf/moonshotai/kimi-k2.5"
const InstanceUpdateParamsAISearchModelAnthropicClaude3_7Sonnet InstanceUpdateParamsAISearchModel = "anthropic/claude-3-7-sonnet"
const InstanceUpdateParamsAISearchModelAnthropicClaudeSonnet4 InstanceUpdateParamsAISearchModel = "anthropic/claude-sonnet-4"
const InstanceUpdateParamsAISearchModelAnthropicClaudeOpus4 InstanceUpdateParamsAISearchModel = "anthropic/claude-opus-4"
const InstanceUpdateParamsAISearchModelAnthropicClaude3_5Haiku InstanceUpdateParamsAISearchModel = "anthropic/claude-3-5-haiku"
const InstanceUpdateParamsAISearchModelCerebrasQwen3_235bA22bInstruct InstanceUpdateParamsAISearchModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceUpdateParamsAISearchModelCerebrasQwen3_235bA22bThinking InstanceUpdateParamsAISearchModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceUpdateParamsAISearchModelCerebrasLlama3_3_70b InstanceUpdateParamsAISearchModel = "cerebras/llama-3.3-70b"
const InstanceUpdateParamsAISearchModelCerebrasLlama4Maverick17b128eInstruct InstanceUpdateParamsAISearchModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceUpdateParamsAISearchModelCerebrasLlama4Scout17b16eInstruct InstanceUpdateParamsAISearchModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceUpdateParamsAISearchModelCerebrasGptOSs120b InstanceUpdateParamsAISearchModel = "cerebras/gpt-oss-120b"
const InstanceUpdateParamsAISearchModelGoogleAIStudioGemini2_5Flash InstanceUpdateParamsAISearchModel = "google-ai-studio/gemini-2.5-flash"
const InstanceUpdateParamsAISearchModelGoogleAIStudioGemini2_5Pro InstanceUpdateParamsAISearchModel = "google-ai-studio/gemini-2.5-pro"
const InstanceUpdateParamsAISearchModelGrokGrok4 InstanceUpdateParamsAISearchModel = "grok/grok-4"
const InstanceUpdateParamsAISearchModelGroqLlama3_3_70bVersatile InstanceUpdateParamsAISearchModel = "groq/llama-3.3-70b-versatile"
const InstanceUpdateParamsAISearchModelGroqLlama3_1_8bInstant InstanceUpdateParamsAISearchModel = "groq/llama-3.1-8b-instant"
const InstanceUpdateParamsAISearchModelOpenAIGpt5 InstanceUpdateParamsAISearchModel = "openai/gpt-5"
const InstanceUpdateParamsAISearchModelOpenAIGpt5Mini InstanceUpdateParamsAISearchModel = "openai/gpt-5-mini"
const InstanceUpdateParamsAISearchModelOpenAIGpt5Nano InstanceUpdateParamsAISearchModel = "openai/gpt-5-nano"
const InstanceUpdateParamsAISearchModelEmpty InstanceUpdateParamsAISearchModel = ""
Cache param.Field[bool]Optional

Body param

CacheThreshold param.Field[InstanceUpdateParamsCacheThreshold]Optional

Body param

const InstanceUpdateParamsCacheThresholdSuperStrictMatch InstanceUpdateParamsCacheThreshold = "super_strict_match"
const InstanceUpdateParamsCacheThresholdCloseEnough InstanceUpdateParamsCacheThreshold = "close_enough"
const InstanceUpdateParamsCacheThresholdFlexibleFriend InstanceUpdateParamsCacheThreshold = "flexible_friend"
const InstanceUpdateParamsCacheThresholdAnythingGoes InstanceUpdateParamsCacheThreshold = "anything_goes"
CacheTTL param.Field[InstanceUpdateParamsCacheTTL]Optional

Body param: Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

const InstanceUpdateParamsCacheTTL600 InstanceUpdateParamsCacheTTL = 600
const InstanceUpdateParamsCacheTTL1800 InstanceUpdateParamsCacheTTL = 1800
const InstanceUpdateParamsCacheTTL3600 InstanceUpdateParamsCacheTTL = 3600
const InstanceUpdateParamsCacheTTL7200 InstanceUpdateParamsCacheTTL = 7200
const InstanceUpdateParamsCacheTTL21600 InstanceUpdateParamsCacheTTL = 21600
const InstanceUpdateParamsCacheTTL43200 InstanceUpdateParamsCacheTTL = 43200
const InstanceUpdateParamsCacheTTL86400 InstanceUpdateParamsCacheTTL = 86400
const InstanceUpdateParamsCacheTTL172800 InstanceUpdateParamsCacheTTL = 172800
const InstanceUpdateParamsCacheTTL259200 InstanceUpdateParamsCacheTTL = 259200
const InstanceUpdateParamsCacheTTL518400 InstanceUpdateParamsCacheTTL = 518400
Chunk param.Field[bool]Optional

Body param

ChunkOverlap param.Field[int64]Optional

Body param

maximum30
minimum0
ChunkSize param.Field[int64]Optional

Body param

minimum64
CustomMetadata param.Field[[]InstanceUpdateParamsCustomMetadata]Optional

Body param

DataType InstanceUpdateParamsCustomMetadataDataType
One of the following:
const InstanceUpdateParamsCustomMetadataDataTypeText InstanceUpdateParamsCustomMetadataDataType = "text"
const InstanceUpdateParamsCustomMetadataDataTypeNumber InstanceUpdateParamsCustomMetadataDataType = "number"
const InstanceUpdateParamsCustomMetadataDataTypeBoolean InstanceUpdateParamsCustomMetadataDataType = "boolean"
const InstanceUpdateParamsCustomMetadataDataTypeDatetime InstanceUpdateParamsCustomMetadataDataType = "datetime"
FieldName string
maxLength64
minLength1
EmbeddingModel param.Field[InstanceUpdateParamsEmbeddingModel]Optional

Body param

const InstanceUpdateParamsEmbeddingModelCfQwenQwen3Embedding0_6b InstanceUpdateParamsEmbeddingModel = "@cf/qwen/qwen3-embedding-0.6b"
const InstanceUpdateParamsEmbeddingModelCfQwenQwen3VlEmbedding2b InstanceUpdateParamsEmbeddingModel = "@cf/qwen/qwen3-vl-embedding-2b"
const InstanceUpdateParamsEmbeddingModelCfBaaiBgeM3 InstanceUpdateParamsEmbeddingModel = "@cf/baai/bge-m3"
const InstanceUpdateParamsEmbeddingModelCfBaaiBgeLargeEnV1_5 InstanceUpdateParamsEmbeddingModel = "@cf/baai/bge-large-en-v1.5"
const InstanceUpdateParamsEmbeddingModelCfGoogleEmbeddinggemma300m InstanceUpdateParamsEmbeddingModel = "@cf/google/embeddinggemma-300m"
const InstanceUpdateParamsEmbeddingModelGoogleAIStudioGeminiEmbedding001 InstanceUpdateParamsEmbeddingModel = "google-ai-studio/gemini-embedding-001"
const InstanceUpdateParamsEmbeddingModelGoogleAIStudioGeminiEmbedding2Preview InstanceUpdateParamsEmbeddingModel = "google-ai-studio/gemini-embedding-2-preview"
const InstanceUpdateParamsEmbeddingModelGoogleAIStudioGeminiEmbedding2 InstanceUpdateParamsEmbeddingModel = "google-ai-studio/gemini-embedding-2"
const InstanceUpdateParamsEmbeddingModelOpenAITextEmbedding3Small InstanceUpdateParamsEmbeddingModel = "openai/text-embedding-3-small"
const InstanceUpdateParamsEmbeddingModelOpenAITextEmbedding3Large InstanceUpdateParamsEmbeddingModel = "openai/text-embedding-3-large"
const InstanceUpdateParamsEmbeddingModelEmpty InstanceUpdateParamsEmbeddingModel = ""
FusionMethod param.Field[InstanceUpdateParamsFusionMethod]Optional

Body param

const InstanceUpdateParamsFusionMethodMax InstanceUpdateParamsFusionMethod = "max"
const InstanceUpdateParamsFusionMethodRrf InstanceUpdateParamsFusionMethod = "rrf"
IndexMethod param.Field[InstanceUpdateParamsIndexMethod]Optional

Body param: Controls which storage backends are used during indexing. Defaults to vector-only.

Keyword bool

Enable keyword (BM25) storage backend.

Vector bool

Enable vector (embedding) storage backend.

IndexingOptions param.Field[InstanceUpdateParamsIndexingOptions]Optional

Body param

KeywordTokenizer InstanceUpdateParamsIndexingOptionsKeywordTokenizerOptional

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
const InstanceUpdateParamsIndexingOptionsKeywordTokenizerPorter InstanceUpdateParamsIndexingOptionsKeywordTokenizer = "porter"
const InstanceUpdateParamsIndexingOptionsKeywordTokenizerTrigram InstanceUpdateParamsIndexingOptionsKeywordTokenizer = "trigram"
MaxNumResults param.Field[int64]Optional

Body param

maximum50
minimum1
Metadata param.Field[InstanceUpdateParamsMetadata]Optional

Body param

CreatedFromAISearchWizard boolOptional
WorkerDomain stringOptional
Paused param.Field[bool]Optional

Body param

PublicEndpointParams param.Field[InstanceUpdateParamsPublicEndpointParams]Optional

Body param

AuthorizedHosts []stringOptional
ChatCompletionsEndpoint InstanceUpdateParamsPublicEndpointParamsChatCompletionsEndpointOptional
Disabled boolOptional

Disable chat completions endpoint for this public endpoint

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).

DefaultDomainEnabled boolOptional

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.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.

Enabled boolOptional
Mcp InstanceUpdateParamsPublicEndpointParamsMcpOptional
Description stringOptional
Disabled boolOptional

Disable MCP endpoint for this public endpoint

RateLimit InstanceUpdateParamsPublicEndpointParamsRateLimitOptional
PeriodMs int64Optional
maximum3600000
minimum60000
Requests int64Optional
minimum1
Technique InstanceUpdateParamsPublicEndpointParamsRateLimitTechniqueOptional
One of the following:
const InstanceUpdateParamsPublicEndpointParamsRateLimitTechniqueFixed InstanceUpdateParamsPublicEndpointParamsRateLimitTechnique = "fixed"
const InstanceUpdateParamsPublicEndpointParamsRateLimitTechniqueSliding InstanceUpdateParamsPublicEndpointParamsRateLimitTechnique = "sliding"
SearchEndpoint InstanceUpdateParamsPublicEndpointParamsSearchEndpointOptional
Disabled boolOptional

Disable search endpoint for this public endpoint

Reranking param.Field[bool]Optional

Body param

RerankingModel param.Field[InstanceUpdateParamsRerankingModel]Optional

Body param

const InstanceUpdateParamsRerankingModelCfBaaiBgeRerankerBase InstanceUpdateParamsRerankingModel = "@cf/baai/bge-reranker-base"
const InstanceUpdateParamsRerankingModelEmpty InstanceUpdateParamsRerankingModel = ""
RetrievalOptions param.Field[InstanceUpdateParamsRetrievalOptions]Optional

Body param

BoostBy []InstanceUpdateParamsRetrievalOptionsBoostByOptional

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

Field string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
Direction InstanceUpdateParamsRetrievalOptionsBoostByDirectionOptional

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
const InstanceUpdateParamsRetrievalOptionsBoostByDirectionAsc InstanceUpdateParamsRetrievalOptionsBoostByDirection = "asc"
const InstanceUpdateParamsRetrievalOptionsBoostByDirectionDesc InstanceUpdateParamsRetrievalOptionsBoostByDirection = "desc"
const InstanceUpdateParamsRetrievalOptionsBoostByDirectionExists InstanceUpdateParamsRetrievalOptionsBoostByDirection = "exists"
const InstanceUpdateParamsRetrievalOptionsBoostByDirectionNotExists InstanceUpdateParamsRetrievalOptionsBoostByDirection = "not_exists"
KeywordMatchMode InstanceUpdateParamsRetrievalOptionsKeywordMatchModeOptional

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
const InstanceUpdateParamsRetrievalOptionsKeywordMatchModeAnd InstanceUpdateParamsRetrievalOptionsKeywordMatchMode = "and"
const InstanceUpdateParamsRetrievalOptionsKeywordMatchModeOr InstanceUpdateParamsRetrievalOptionsKeywordMatchMode = "or"
RewriteModel param.Field[InstanceUpdateParamsRewriteModel]Optional

Body param

const InstanceUpdateParamsRewriteModelCfMetaLlama3_3_70bInstructFp8Fast InstanceUpdateParamsRewriteModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceUpdateParamsRewriteModelCfZaiOrgGlm4_7Flash InstanceUpdateParamsRewriteModel = "@cf/zai-org/glm-4.7-flash"
const InstanceUpdateParamsRewriteModelCfMetaLlama3_1_8bInstructFast InstanceUpdateParamsRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceUpdateParamsRewriteModelCfMetaLlama3_1_8bInstructFp8 InstanceUpdateParamsRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceUpdateParamsRewriteModelCfMetaLlama4Scout17b16eInstruct InstanceUpdateParamsRewriteModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceUpdateParamsRewriteModelCfQwenQwen3_30bA3bFp8 InstanceUpdateParamsRewriteModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceUpdateParamsRewriteModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceUpdateParamsRewriteModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceUpdateParamsRewriteModelCfMoonshotaiKimiK2Instruct InstanceUpdateParamsRewriteModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceUpdateParamsRewriteModelCfGoogleGemma3_12bIt InstanceUpdateParamsRewriteModel = "@cf/google/gemma-3-12b-it"
const InstanceUpdateParamsRewriteModelCfGoogleGemma4_26bA4bIt InstanceUpdateParamsRewriteModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceUpdateParamsRewriteModelCfMoonshotaiKimiK2_5 InstanceUpdateParamsRewriteModel = "@cf/moonshotai/kimi-k2.5"
const InstanceUpdateParamsRewriteModelAnthropicClaude3_7Sonnet InstanceUpdateParamsRewriteModel = "anthropic/claude-3-7-sonnet"
const InstanceUpdateParamsRewriteModelAnthropicClaudeSonnet4 InstanceUpdateParamsRewriteModel = "anthropic/claude-sonnet-4"
const InstanceUpdateParamsRewriteModelAnthropicClaudeOpus4 InstanceUpdateParamsRewriteModel = "anthropic/claude-opus-4"
const InstanceUpdateParamsRewriteModelAnthropicClaude3_5Haiku InstanceUpdateParamsRewriteModel = "anthropic/claude-3-5-haiku"
const InstanceUpdateParamsRewriteModelCerebrasQwen3_235bA22bInstruct InstanceUpdateParamsRewriteModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceUpdateParamsRewriteModelCerebrasQwen3_235bA22bThinking InstanceUpdateParamsRewriteModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceUpdateParamsRewriteModelCerebrasLlama3_3_70b InstanceUpdateParamsRewriteModel = "cerebras/llama-3.3-70b"
const InstanceUpdateParamsRewriteModelCerebrasLlama4Maverick17b128eInstruct InstanceUpdateParamsRewriteModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceUpdateParamsRewriteModelCerebrasLlama4Scout17b16eInstruct InstanceUpdateParamsRewriteModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceUpdateParamsRewriteModelCerebrasGptOSs120b InstanceUpdateParamsRewriteModel = "cerebras/gpt-oss-120b"
const InstanceUpdateParamsRewriteModelGoogleAIStudioGemini2_5Flash InstanceUpdateParamsRewriteModel = "google-ai-studio/gemini-2.5-flash"
const InstanceUpdateParamsRewriteModelGoogleAIStudioGemini2_5Pro InstanceUpdateParamsRewriteModel = "google-ai-studio/gemini-2.5-pro"
const InstanceUpdateParamsRewriteModelGrokGrok4 InstanceUpdateParamsRewriteModel = "grok/grok-4"
const InstanceUpdateParamsRewriteModelGroqLlama3_3_70bVersatile InstanceUpdateParamsRewriteModel = "groq/llama-3.3-70b-versatile"
const InstanceUpdateParamsRewriteModelGroqLlama3_1_8bInstant InstanceUpdateParamsRewriteModel = "groq/llama-3.1-8b-instant"
const InstanceUpdateParamsRewriteModelOpenAIGpt5 InstanceUpdateParamsRewriteModel = "openai/gpt-5"
const InstanceUpdateParamsRewriteModelOpenAIGpt5Mini InstanceUpdateParamsRewriteModel = "openai/gpt-5-mini"
const InstanceUpdateParamsRewriteModelOpenAIGpt5Nano InstanceUpdateParamsRewriteModel = "openai/gpt-5-nano"
const InstanceUpdateParamsRewriteModelEmpty InstanceUpdateParamsRewriteModel = ""
RewriteQuery param.Field[bool]Optional

Body param

ScoreThreshold param.Field[float64]Optional

Body param

maximum1
minimum0
Source param.Field[string]Optional

Body param

SourceParams param.Field[InstanceUpdateParamsSourceParams]Optional

Body param

ExcludeItems []stringOptional

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced)

IncludeItems []stringOptional

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post)

Prefix stringOptional
R2Jurisdiction stringOptional
WebCrawler InstanceUpdateParamsSourceParamsWebCrawlerOptional
ParseOptions InstanceUpdateParamsSourceParamsWebCrawlerParseOptionsOptional
ContentSelector []InstanceUpdateParamsSourceParamsWebCrawlerParseOptionsContentSelectorOptional

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

Path string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
Selector string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
IncludeHeaders map[string, string]Optional

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

IncludeImages boolOptional
SpecificSitemaps []stringOptional

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

UseBrowserRendering boolOptional
ParseType InstanceUpdateParamsSourceParamsWebCrawlerParseTypeOptional
One of the following:
const InstanceUpdateParamsSourceParamsWebCrawlerParseTypeSitemap InstanceUpdateParamsSourceParamsWebCrawlerParseType = "sitemap"
const InstanceUpdateParamsSourceParamsWebCrawlerParseTypeCrawl InstanceUpdateParamsSourceParamsWebCrawlerParseType = "crawl"
Summarization param.Field[bool]Optional

Body param

SummarizationModel param.Field[InstanceUpdateParamsSummarizationModel]Optional

Body param

const InstanceUpdateParamsSummarizationModelCfMetaLlama3_3_70bInstructFp8Fast InstanceUpdateParamsSummarizationModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceUpdateParamsSummarizationModelCfZaiOrgGlm4_7Flash InstanceUpdateParamsSummarizationModel = "@cf/zai-org/glm-4.7-flash"
const InstanceUpdateParamsSummarizationModelCfMetaLlama3_1_8bInstructFast InstanceUpdateParamsSummarizationModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceUpdateParamsSummarizationModelCfMetaLlama3_1_8bInstructFp8 InstanceUpdateParamsSummarizationModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceUpdateParamsSummarizationModelCfMetaLlama4Scout17b16eInstruct InstanceUpdateParamsSummarizationModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceUpdateParamsSummarizationModelCfQwenQwen3_30bA3bFp8 InstanceUpdateParamsSummarizationModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceUpdateParamsSummarizationModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceUpdateParamsSummarizationModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceUpdateParamsSummarizationModelCfMoonshotaiKimiK2Instruct InstanceUpdateParamsSummarizationModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceUpdateParamsSummarizationModelCfGoogleGemma3_12bIt InstanceUpdateParamsSummarizationModel = "@cf/google/gemma-3-12b-it"
const InstanceUpdateParamsSummarizationModelCfGoogleGemma4_26bA4bIt InstanceUpdateParamsSummarizationModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceUpdateParamsSummarizationModelCfMoonshotaiKimiK2_5 InstanceUpdateParamsSummarizationModel = "@cf/moonshotai/kimi-k2.5"
const InstanceUpdateParamsSummarizationModelAnthropicClaude3_7Sonnet InstanceUpdateParamsSummarizationModel = "anthropic/claude-3-7-sonnet"
const InstanceUpdateParamsSummarizationModelAnthropicClaudeSonnet4 InstanceUpdateParamsSummarizationModel = "anthropic/claude-sonnet-4"
const InstanceUpdateParamsSummarizationModelAnthropicClaudeOpus4 InstanceUpdateParamsSummarizationModel = "anthropic/claude-opus-4"
const InstanceUpdateParamsSummarizationModelAnthropicClaude3_5Haiku InstanceUpdateParamsSummarizationModel = "anthropic/claude-3-5-haiku"
const InstanceUpdateParamsSummarizationModelCerebrasQwen3_235bA22bInstruct InstanceUpdateParamsSummarizationModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceUpdateParamsSummarizationModelCerebrasQwen3_235bA22bThinking InstanceUpdateParamsSummarizationModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceUpdateParamsSummarizationModelCerebrasLlama3_3_70b InstanceUpdateParamsSummarizationModel = "cerebras/llama-3.3-70b"
const InstanceUpdateParamsSummarizationModelCerebrasLlama4Maverick17b128eInstruct InstanceUpdateParamsSummarizationModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceUpdateParamsSummarizationModelCerebrasLlama4Scout17b16eInstruct InstanceUpdateParamsSummarizationModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceUpdateParamsSummarizationModelCerebrasGptOSs120b InstanceUpdateParamsSummarizationModel = "cerebras/gpt-oss-120b"
const InstanceUpdateParamsSummarizationModelGoogleAIStudioGemini2_5Flash InstanceUpdateParamsSummarizationModel = "google-ai-studio/gemini-2.5-flash"
const InstanceUpdateParamsSummarizationModelGoogleAIStudioGemini2_5Pro InstanceUpdateParamsSummarizationModel = "google-ai-studio/gemini-2.5-pro"
const InstanceUpdateParamsSummarizationModelGrokGrok4 InstanceUpdateParamsSummarizationModel = "grok/grok-4"
const InstanceUpdateParamsSummarizationModelGroqLlama3_3_70bVersatile InstanceUpdateParamsSummarizationModel = "groq/llama-3.3-70b-versatile"
const InstanceUpdateParamsSummarizationModelGroqLlama3_1_8bInstant InstanceUpdateParamsSummarizationModel = "groq/llama-3.1-8b-instant"
const InstanceUpdateParamsSummarizationModelOpenAIGpt5 InstanceUpdateParamsSummarizationModel = "openai/gpt-5"
const InstanceUpdateParamsSummarizationModelOpenAIGpt5Mini InstanceUpdateParamsSummarizationModel = "openai/gpt-5-mini"
const InstanceUpdateParamsSummarizationModelOpenAIGpt5Nano InstanceUpdateParamsSummarizationModel = "openai/gpt-5-nano"
const InstanceUpdateParamsSummarizationModelEmpty InstanceUpdateParamsSummarizationModel = ""
SyncInterval param.Field[InstanceUpdateParamsSyncInterval]Optional

Body param: Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

const InstanceUpdateParamsSyncInterval900 InstanceUpdateParamsSyncInterval = 900
const InstanceUpdateParamsSyncInterval1800 InstanceUpdateParamsSyncInterval = 1800
const InstanceUpdateParamsSyncInterval3600 InstanceUpdateParamsSyncInterval = 3600
const InstanceUpdateParamsSyncInterval7200 InstanceUpdateParamsSyncInterval = 7200
const InstanceUpdateParamsSyncInterval14400 InstanceUpdateParamsSyncInterval = 14400
const InstanceUpdateParamsSyncInterval21600 InstanceUpdateParamsSyncInterval = 21600
const InstanceUpdateParamsSyncInterval43200 InstanceUpdateParamsSyncInterval = 43200
const InstanceUpdateParamsSyncInterval86400 InstanceUpdateParamsSyncInterval = 86400
SystemPromptIndexSummarization param.Field[string]Optional

Body param

SystemPromptRewriteQuery param.Field[string]Optional

Body param

TokenID param.Field[string]Optional

Body param

formatuuid
ReturnsExpand Collapse
type InstanceUpdateResponse struct{…}
ID string

AI Search instance ID. Lowercase alphanumeric, hyphens, and underscores.

maxLength64
minLength1
CreatedAt Time
formatdate-time
ModifiedAt Time
formatdate-time
AIGatewayID stringOptional
AISearchModel InstanceUpdateResponseAISearchModelOptional
One of the following:
const InstanceUpdateResponseAISearchModelCfMetaLlama3_3_70bInstructFp8Fast InstanceUpdateResponseAISearchModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceUpdateResponseAISearchModelCfZaiOrgGlm4_7Flash InstanceUpdateResponseAISearchModel = "@cf/zai-org/glm-4.7-flash"
const InstanceUpdateResponseAISearchModelCfMetaLlama3_1_8bInstructFast InstanceUpdateResponseAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceUpdateResponseAISearchModelCfMetaLlama3_1_8bInstructFp8 InstanceUpdateResponseAISearchModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceUpdateResponseAISearchModelCfMetaLlama4Scout17b16eInstruct InstanceUpdateResponseAISearchModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceUpdateResponseAISearchModelCfQwenQwen3_30bA3bFp8 InstanceUpdateResponseAISearchModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceUpdateResponseAISearchModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceUpdateResponseAISearchModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceUpdateResponseAISearchModelCfMoonshotaiKimiK2Instruct InstanceUpdateResponseAISearchModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceUpdateResponseAISearchModelCfGoogleGemma3_12bIt InstanceUpdateResponseAISearchModel = "@cf/google/gemma-3-12b-it"
const InstanceUpdateResponseAISearchModelCfGoogleGemma4_26bA4bIt InstanceUpdateResponseAISearchModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceUpdateResponseAISearchModelCfMoonshotaiKimiK2_5 InstanceUpdateResponseAISearchModel = "@cf/moonshotai/kimi-k2.5"
const InstanceUpdateResponseAISearchModelAnthropicClaude3_7Sonnet InstanceUpdateResponseAISearchModel = "anthropic/claude-3-7-sonnet"
const InstanceUpdateResponseAISearchModelAnthropicClaudeSonnet4 InstanceUpdateResponseAISearchModel = "anthropic/claude-sonnet-4"
const InstanceUpdateResponseAISearchModelAnthropicClaudeOpus4 InstanceUpdateResponseAISearchModel = "anthropic/claude-opus-4"
const InstanceUpdateResponseAISearchModelAnthropicClaude3_5Haiku InstanceUpdateResponseAISearchModel = "anthropic/claude-3-5-haiku"
const InstanceUpdateResponseAISearchModelCerebrasQwen3_235bA22bInstruct InstanceUpdateResponseAISearchModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceUpdateResponseAISearchModelCerebrasQwen3_235bA22bThinking InstanceUpdateResponseAISearchModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceUpdateResponseAISearchModelCerebrasLlama3_3_70b InstanceUpdateResponseAISearchModel = "cerebras/llama-3.3-70b"
const InstanceUpdateResponseAISearchModelCerebrasLlama4Maverick17b128eInstruct InstanceUpdateResponseAISearchModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceUpdateResponseAISearchModelCerebrasLlama4Scout17b16eInstruct InstanceUpdateResponseAISearchModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceUpdateResponseAISearchModelCerebrasGptOSs120b InstanceUpdateResponseAISearchModel = "cerebras/gpt-oss-120b"
const InstanceUpdateResponseAISearchModelGoogleAIStudioGemini2_5Flash InstanceUpdateResponseAISearchModel = "google-ai-studio/gemini-2.5-flash"
const InstanceUpdateResponseAISearchModelGoogleAIStudioGemini2_5Pro InstanceUpdateResponseAISearchModel = "google-ai-studio/gemini-2.5-pro"
const InstanceUpdateResponseAISearchModelGrokGrok4 InstanceUpdateResponseAISearchModel = "grok/grok-4"
const InstanceUpdateResponseAISearchModelGroqLlama3_3_70bVersatile InstanceUpdateResponseAISearchModel = "groq/llama-3.3-70b-versatile"
const InstanceUpdateResponseAISearchModelGroqLlama3_1_8bInstant InstanceUpdateResponseAISearchModel = "groq/llama-3.1-8b-instant"
const InstanceUpdateResponseAISearchModelOpenAIGpt5 InstanceUpdateResponseAISearchModel = "openai/gpt-5"
const InstanceUpdateResponseAISearchModelOpenAIGpt5Mini InstanceUpdateResponseAISearchModel = "openai/gpt-5-mini"
const InstanceUpdateResponseAISearchModelOpenAIGpt5Nano InstanceUpdateResponseAISearchModel = "openai/gpt-5-nano"
const InstanceUpdateResponseAISearchModelEmpty InstanceUpdateResponseAISearchModel = ""
Cache boolOptional
CacheThreshold InstanceUpdateResponseCacheThresholdOptional
One of the following:
const InstanceUpdateResponseCacheThresholdSuperStrictMatch InstanceUpdateResponseCacheThreshold = "super_strict_match"
const InstanceUpdateResponseCacheThresholdCloseEnough InstanceUpdateResponseCacheThreshold = "close_enough"
const InstanceUpdateResponseCacheThresholdFlexibleFriend InstanceUpdateResponseCacheThreshold = "flexible_friend"
const InstanceUpdateResponseCacheThresholdAnythingGoes InstanceUpdateResponseCacheThreshold = "anything_goes"
CacheTTL InstanceUpdateResponseCacheTTLOptional

Cache entry TTL in seconds. Allowed values: 600 (10min), 1800 (30min), 3600 (1h), 7200 (2h), 21600 (6h), 43200 (12h), 86400 (24h), 172800 (48h), 259200 (72h), 518400 (6d).

One of the following:
const InstanceUpdateResponseCacheTTL600 InstanceUpdateResponseCacheTTL = 600
const InstanceUpdateResponseCacheTTL1800 InstanceUpdateResponseCacheTTL = 1800
const InstanceUpdateResponseCacheTTL3600 InstanceUpdateResponseCacheTTL = 3600
const InstanceUpdateResponseCacheTTL7200 InstanceUpdateResponseCacheTTL = 7200
const InstanceUpdateResponseCacheTTL21600 InstanceUpdateResponseCacheTTL = 21600
const InstanceUpdateResponseCacheTTL43200 InstanceUpdateResponseCacheTTL = 43200
const InstanceUpdateResponseCacheTTL86400 InstanceUpdateResponseCacheTTL = 86400
const InstanceUpdateResponseCacheTTL172800 InstanceUpdateResponseCacheTTL = 172800
const InstanceUpdateResponseCacheTTL259200 InstanceUpdateResponseCacheTTL = 259200
const InstanceUpdateResponseCacheTTL518400 InstanceUpdateResponseCacheTTL = 518400
ChunkOverlap int64Optional
maximum30
minimum0
ChunkSize int64Optional
minimum64
CreatedBy stringOptional
CustomMetadata []InstanceUpdateResponseCustomMetadataOptional
DataType InstanceUpdateResponseCustomMetadataDataType
One of the following:
const InstanceUpdateResponseCustomMetadataDataTypeText InstanceUpdateResponseCustomMetadataDataType = "text"
const InstanceUpdateResponseCustomMetadataDataTypeNumber InstanceUpdateResponseCustomMetadataDataType = "number"
const InstanceUpdateResponseCustomMetadataDataTypeBoolean InstanceUpdateResponseCustomMetadataDataType = "boolean"
const InstanceUpdateResponseCustomMetadataDataTypeDatetime InstanceUpdateResponseCustomMetadataDataType = "datetime"
FieldName string
maxLength64
minLength1
EmbeddingModel InstanceUpdateResponseEmbeddingModelOptional
One of the following:
const InstanceUpdateResponseEmbeddingModelCfQwenQwen3Embedding0_6b InstanceUpdateResponseEmbeddingModel = "@cf/qwen/qwen3-embedding-0.6b"
const InstanceUpdateResponseEmbeddingModelCfQwenQwen3VlEmbedding2b InstanceUpdateResponseEmbeddingModel = "@cf/qwen/qwen3-vl-embedding-2b"
const InstanceUpdateResponseEmbeddingModelCfBaaiBgeM3 InstanceUpdateResponseEmbeddingModel = "@cf/baai/bge-m3"
const InstanceUpdateResponseEmbeddingModelCfBaaiBgeLargeEnV1_5 InstanceUpdateResponseEmbeddingModel = "@cf/baai/bge-large-en-v1.5"
const InstanceUpdateResponseEmbeddingModelCfGoogleEmbeddinggemma300m InstanceUpdateResponseEmbeddingModel = "@cf/google/embeddinggemma-300m"
const InstanceUpdateResponseEmbeddingModelGoogleAIStudioGeminiEmbedding001 InstanceUpdateResponseEmbeddingModel = "google-ai-studio/gemini-embedding-001"
const InstanceUpdateResponseEmbeddingModelGoogleAIStudioGeminiEmbedding2Preview InstanceUpdateResponseEmbeddingModel = "google-ai-studio/gemini-embedding-2-preview"
const InstanceUpdateResponseEmbeddingModelGoogleAIStudioGeminiEmbedding2 InstanceUpdateResponseEmbeddingModel = "google-ai-studio/gemini-embedding-2"
const InstanceUpdateResponseEmbeddingModelOpenAITextEmbedding3Small InstanceUpdateResponseEmbeddingModel = "openai/text-embedding-3-small"
const InstanceUpdateResponseEmbeddingModelOpenAITextEmbedding3Large InstanceUpdateResponseEmbeddingModel = "openai/text-embedding-3-large"
const InstanceUpdateResponseEmbeddingModelEmpty InstanceUpdateResponseEmbeddingModel = ""
Enable boolOptional
EngineVersion float64Optional
FusionMethod InstanceUpdateResponseFusionMethodOptional
One of the following:
const InstanceUpdateResponseFusionMethodMax InstanceUpdateResponseFusionMethod = "max"
const InstanceUpdateResponseFusionMethodRrf InstanceUpdateResponseFusionMethod = "rrf"
DeprecatedHybridSearchEnabled boolOptional

Deprecated — use index_method instead.

IndexMethod InstanceUpdateResponseIndexMethodOptional

Controls which storage backends are used during indexing. Defaults to vector-only.

Keyword bool

Enable keyword (BM25) storage backend.

Vector bool

Enable vector (embedding) storage backend.

IndexingOptions InstanceUpdateResponseIndexingOptionsOptional
KeywordTokenizer InstanceUpdateResponseIndexingOptionsKeywordTokenizerOptional

Tokenizer used for keyword search indexing. porter provides word-level tokenization with Porter stemming (good for natural language queries). trigram enables character-level substring matching (good for partial matches, code, identifiers). Changing this triggers a full re-index. Defaults to porter.

One of the following:
const InstanceUpdateResponseIndexingOptionsKeywordTokenizerPorter InstanceUpdateResponseIndexingOptionsKeywordTokenizer = "porter"
const InstanceUpdateResponseIndexingOptionsKeywordTokenizerTrigram InstanceUpdateResponseIndexingOptionsKeywordTokenizer = "trigram"
LastActivity TimeOptional
formatdate-time
MaxNumResults int64Optional
maximum50
minimum1
Metadata InstanceUpdateResponseMetadataOptional
CreatedFromAISearchWizard boolOptional
WorkerDomain stringOptional
ModifiedBy stringOptional
Namespace stringOptional
Paused boolOptional
PublicEndpointID stringOptional
PublicEndpointParams InstanceUpdateResponsePublicEndpointParamsOptional
AuthorizedHosts []stringOptional
ChatCompletionsEndpoint InstanceUpdateResponsePublicEndpointParamsChatCompletionsEndpointOptional
Disabled boolOptional

Disable chat completions endpoint for this public endpoint

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).

DefaultDomainEnabled boolOptional

When false, the instance is reachable only via a registered custom domain and the default <public_endpoint_id>.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.

Enabled boolOptional
Mcp InstanceUpdateResponsePublicEndpointParamsMcpOptional
Description stringOptional
Disabled boolOptional

Disable MCP endpoint for this public endpoint

RateLimit InstanceUpdateResponsePublicEndpointParamsRateLimitOptional
PeriodMs int64Optional
maximum3600000
minimum60000
Requests int64Optional
minimum1
Technique InstanceUpdateResponsePublicEndpointParamsRateLimitTechniqueOptional
One of the following:
const InstanceUpdateResponsePublicEndpointParamsRateLimitTechniqueFixed InstanceUpdateResponsePublicEndpointParamsRateLimitTechnique = "fixed"
const InstanceUpdateResponsePublicEndpointParamsRateLimitTechniqueSliding InstanceUpdateResponsePublicEndpointParamsRateLimitTechnique = "sliding"
SearchEndpoint InstanceUpdateResponsePublicEndpointParamsSearchEndpointOptional
Disabled boolOptional

Disable search endpoint for this public endpoint

Reranking boolOptional
RerankingModel InstanceUpdateResponseRerankingModelOptional
One of the following:
const InstanceUpdateResponseRerankingModelCfBaaiBgeRerankerBase InstanceUpdateResponseRerankingModel = "@cf/baai/bge-reranker-base"
const InstanceUpdateResponseRerankingModelEmpty InstanceUpdateResponseRerankingModel = ""
RetrievalOptions InstanceUpdateResponseRetrievalOptionsOptional
BoostBy []InstanceUpdateResponseRetrievalOptionsBoostByOptional

Metadata fields to boost search results by. Each entry specifies a metadata field and an optional direction. Direction defaults to ‘asc’ for numeric/datetime fields and ‘exists’ for text/boolean fields. Fields must match ‘timestamp’ or a defined custom_metadata field.

Field string

Metadata field name to boost by. Use ‘timestamp’ for document freshness, or any custom_metadata field. Numeric and datetime fields support all four directions (asc, desc, exists, not_exists); text/boolean fields only support exists/not_exists.

maxLength64
minLength1
Direction InstanceUpdateResponseRetrievalOptionsBoostByDirectionOptional

Boost direction. ‘desc’ = higher values rank higher (e.g. newer timestamps). ‘asc’ = lower values rank higher. ‘exists’ = boost chunks that have the field. ‘not_exists’ = boost chunks that lack the field. Optional — defaults to ‘asc’ for numeric/datetime fields, ‘exists’ for text/boolean fields.

One of the following:
const InstanceUpdateResponseRetrievalOptionsBoostByDirectionAsc InstanceUpdateResponseRetrievalOptionsBoostByDirection = "asc"
const InstanceUpdateResponseRetrievalOptionsBoostByDirectionDesc InstanceUpdateResponseRetrievalOptionsBoostByDirection = "desc"
const InstanceUpdateResponseRetrievalOptionsBoostByDirectionExists InstanceUpdateResponseRetrievalOptionsBoostByDirection = "exists"
const InstanceUpdateResponseRetrievalOptionsBoostByDirectionNotExists InstanceUpdateResponseRetrievalOptionsBoostByDirection = "not_exists"
KeywordMatchMode InstanceUpdateResponseRetrievalOptionsKeywordMatchModeOptional

Controls which documents are candidates for BM25 scoring. ‘and’ restricts candidates to documents containing all query terms; ‘or’ includes any document containing at least one term, ranked by BM25 relevance. When omitted on an update, the existing stored value is preserved; when never set, search falls back to ‘and’.

One of the following:
const InstanceUpdateResponseRetrievalOptionsKeywordMatchModeAnd InstanceUpdateResponseRetrievalOptionsKeywordMatchMode = "and"
const InstanceUpdateResponseRetrievalOptionsKeywordMatchModeOr InstanceUpdateResponseRetrievalOptionsKeywordMatchMode = "or"
RewriteModel InstanceUpdateResponseRewriteModelOptional
One of the following:
const InstanceUpdateResponseRewriteModelCfMetaLlama3_3_70bInstructFp8Fast InstanceUpdateResponseRewriteModel = "@cf/meta/llama-3.3-70b-instruct-fp8-fast"
const InstanceUpdateResponseRewriteModelCfZaiOrgGlm4_7Flash InstanceUpdateResponseRewriteModel = "@cf/zai-org/glm-4.7-flash"
const InstanceUpdateResponseRewriteModelCfMetaLlama3_1_8bInstructFast InstanceUpdateResponseRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fast"
const InstanceUpdateResponseRewriteModelCfMetaLlama3_1_8bInstructFp8 InstanceUpdateResponseRewriteModel = "@cf/meta/llama-3.1-8b-instruct-fp8"
const InstanceUpdateResponseRewriteModelCfMetaLlama4Scout17b16eInstruct InstanceUpdateResponseRewriteModel = "@cf/meta/llama-4-scout-17b-16e-instruct"
const InstanceUpdateResponseRewriteModelCfQwenQwen3_30bA3bFp8 InstanceUpdateResponseRewriteModel = "@cf/qwen/qwen3-30b-a3b-fp8"
const InstanceUpdateResponseRewriteModelCfDeepseekAIDeepseekR1DistillQwen32b InstanceUpdateResponseRewriteModel = "@cf/deepseek-ai/deepseek-r1-distill-qwen-32b"
const InstanceUpdateResponseRewriteModelCfMoonshotaiKimiK2Instruct InstanceUpdateResponseRewriteModel = "@cf/moonshotai/kimi-k2-instruct"
const InstanceUpdateResponseRewriteModelCfGoogleGemma3_12bIt InstanceUpdateResponseRewriteModel = "@cf/google/gemma-3-12b-it"
const InstanceUpdateResponseRewriteModelCfGoogleGemma4_26bA4bIt InstanceUpdateResponseRewriteModel = "@cf/google/gemma-4-26b-a4b-it"
const InstanceUpdateResponseRewriteModelCfMoonshotaiKimiK2_5 InstanceUpdateResponseRewriteModel = "@cf/moonshotai/kimi-k2.5"
const InstanceUpdateResponseRewriteModelAnthropicClaude3_7Sonnet InstanceUpdateResponseRewriteModel = "anthropic/claude-3-7-sonnet"
const InstanceUpdateResponseRewriteModelAnthropicClaudeSonnet4 InstanceUpdateResponseRewriteModel = "anthropic/claude-sonnet-4"
const InstanceUpdateResponseRewriteModelAnthropicClaudeOpus4 InstanceUpdateResponseRewriteModel = "anthropic/claude-opus-4"
const InstanceUpdateResponseRewriteModelAnthropicClaude3_5Haiku InstanceUpdateResponseRewriteModel = "anthropic/claude-3-5-haiku"
const InstanceUpdateResponseRewriteModelCerebrasQwen3_235bA22bInstruct InstanceUpdateResponseRewriteModel = "cerebras/qwen-3-235b-a22b-instruct"
const InstanceUpdateResponseRewriteModelCerebrasQwen3_235bA22bThinking InstanceUpdateResponseRewriteModel = "cerebras/qwen-3-235b-a22b-thinking"
const InstanceUpdateResponseRewriteModelCerebrasLlama3_3_70b InstanceUpdateResponseRewriteModel = "cerebras/llama-3.3-70b"
const InstanceUpdateResponseRewriteModelCerebrasLlama4Maverick17b128eInstruct InstanceUpdateResponseRewriteModel = "cerebras/llama-4-maverick-17b-128e-instruct"
const InstanceUpdateResponseRewriteModelCerebrasLlama4Scout17b16eInstruct InstanceUpdateResponseRewriteModel = "cerebras/llama-4-scout-17b-16e-instruct"
const InstanceUpdateResponseRewriteModelCerebrasGptOSs120b InstanceUpdateResponseRewriteModel = "cerebras/gpt-oss-120b"
const InstanceUpdateResponseRewriteModelGoogleAIStudioGemini2_5Flash InstanceUpdateResponseRewriteModel = "google-ai-studio/gemini-2.5-flash"
const InstanceUpdateResponseRewriteModelGoogleAIStudioGemini2_5Pro InstanceUpdateResponseRewriteModel = "google-ai-studio/gemini-2.5-pro"
const InstanceUpdateResponseRewriteModelGrokGrok4 InstanceUpdateResponseRewriteModel = "grok/grok-4"
const InstanceUpdateResponseRewriteModelGroqLlama3_3_70bVersatile InstanceUpdateResponseRewriteModel = "groq/llama-3.3-70b-versatile"
const InstanceUpdateResponseRewriteModelGroqLlama3_1_8bInstant InstanceUpdateResponseRewriteModel = "groq/llama-3.1-8b-instant"
const InstanceUpdateResponseRewriteModelOpenAIGpt5 InstanceUpdateResponseRewriteModel = "openai/gpt-5"
const InstanceUpdateResponseRewriteModelOpenAIGpt5Mini InstanceUpdateResponseRewriteModel = "openai/gpt-5-mini"
const InstanceUpdateResponseRewriteModelOpenAIGpt5Nano InstanceUpdateResponseRewriteModel = "openai/gpt-5-nano"
const InstanceUpdateResponseRewriteModelEmpty InstanceUpdateResponseRewriteModel = ""
RewriteQuery boolOptional
ScoreThreshold float64Optional
maximum1
minimum0
Source stringOptional
SourceParams InstanceUpdateResponseSourceParamsOptional
ExcludeItems []stringOptional

List of path patterns to exclude. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /admin/** matches /admin/users and /admin/settings/advanced)

IncludeItems []stringOptional

List of path patterns to include. Uses micromatch glob syntax: * matches within a path segment, ** matches across path segments (e.g., /blog/** matches /blog/post and /blog/2024/post)

Prefix stringOptional
R2Jurisdiction stringOptional
WebCrawler InstanceUpdateResponseSourceParamsWebCrawlerOptional
ParseOptions InstanceUpdateResponseSourceParamsWebCrawlerParseOptionsOptional
ContentSelector []InstanceUpdateResponseSourceParamsWebCrawlerParseOptionsContentSelectorOptional

List of path-to-selector mappings for extracting specific content from crawled pages. Each entry pairs a URL glob pattern with a CSS selector. The first matching path wins. Only the matched HTML fragment is stored and indexed. Omit the field to disable content selection — empty arrays are rejected.

Path string

Glob pattern to match against the page URL path. Uses standard glob syntax: * matches within a segment, ** crosses directories.

maxLength200
minLength1
Selector string

CSS selector to extract content from pages matching the path pattern. Must not contain disallowed characters (;, `, $, {, }, ). Must target a single element; if multiple elements match, the selector is ignored and the full page is used.

maxLength200
minLength1
IncludeHeaders map[string, string]Optional

Up to 5 custom HTTP headers sent with each crawl request. Names must be RFC-7230 token characters (no spaces, colons, or control characters); values must be HTAB + printable ASCII (no CR/LF).

IncludeImages boolOptional
SpecificSitemaps []stringOptional

List of specific sitemap URLs to use for crawling. Only valid when parse_type is ‘sitemap’.

UseBrowserRendering boolOptional
ParseType InstanceUpdateResponseSourceParamsWebCrawlerParseTypeOptional
One of the following:
const InstanceUpdateResponseSourceParamsWebCrawlerParseTypeSitemap InstanceUpdateResponseSourceParamsWebCrawlerParseType = "sitemap"
const InstanceUpdateResponseSourceParamsWebCrawlerParseTypeCrawl InstanceUpdateResponseSourceParamsWebCrawlerParseType = "crawl"
Status stringOptional
SyncInterval InstanceUpdateResponseSyncIntervalOptional

Interval between automatic syncs, in seconds. Allowed values: 900 (15min), 1800 (30min), 3600 (1h), 7200 (2h), 14400 (4h), 21600 (6h), 43200 (12h), 86400 (24h).

One of the following:
const InstanceUpdateResponseSyncInterval900 InstanceUpdateResponseSyncInterval = 900
const InstanceUpdateResponseSyncInterval1800 InstanceUpdateResponseSyncInterval = 1800
const InstanceUpdateResponseSyncInterval3600 InstanceUpdateResponseSyncInterval = 3600
const InstanceUpdateResponseSyncInterval7200 InstanceUpdateResponseSyncInterval = 7200
const InstanceUpdateResponseSyncInterval14400 InstanceUpdateResponseSyncInterval = 14400
const InstanceUpdateResponseSyncInterval21600 InstanceUpdateResponseSyncInterval = 21600
const InstanceUpdateResponseSyncInterval43200 InstanceUpdateResponseSyncInterval = 43200
const InstanceUpdateResponseSyncInterval86400 InstanceUpdateResponseSyncInterval = 86400
TokenID stringOptional
formatuuid
Type InstanceUpdateResponseTypeOptional
One of the following:
const InstanceUpdateResponseTypeR2 InstanceUpdateResponseType = "r2"
const InstanceUpdateResponseTypeWebCrawler InstanceUpdateResponseType = "web-crawler"

Update an AI Search instance.

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"),
  )
  instance, err := client.AISearch.Instances.Update(
    context.TODO(),
    "my-ai-search",
    ai_search.InstanceUpdateParams{
      AccountID: cloudflare.F("c3dc5f0b34a14ff8e1b3ec04895e1b22"),
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", instance.ID)
}
{
  "result": {
    "id": "my-ai-search",
    "created_at": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "ai_gateway_id": "ai_gateway_id",
    "ai_search_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "cache": true,
    "cache_threshold": "super_strict_match",
    "cache_ttl": 600,
    "chunk_overlap": 0,
    "chunk_size": 64,
    "created_by": "created_by",
    "custom_metadata": [
      {
        "data_type": "text",
        "field_name": "x"
      }
    ],
    "embedding_model": "@cf/qwen/qwen3-embedding-0.6b",
    "enable": true,
    "engine_version": 0,
    "fusion_method": "max",
    "hybrid_search_enabled": true,
    "index_method": {
      "keyword": true,
      "vector": true
    },
    "indexing_options": {
      "keyword_tokenizer": "porter"
    },
    "last_activity": "2019-12-27T18:11:19.117Z",
    "max_num_results": 1,
    "metadata": {
      "created_from_aisearch_wizard": true,
      "worker_domain": "worker_domain"
    },
    "modified_by": "modified_by",
    "namespace": "namespace",
    "paused": true,
    "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,
      "mcp": {
        "description": "description",
        "disabled": true
      },
      "rate_limit": {
        "period_ms": 60000,
        "requests": 1,
        "technique": "fixed"
      },
      "search_endpoint": {
        "disabled": true
      }
    },
    "reranking": true,
    "reranking_model": "@cf/baai/bge-reranker-base",
    "retrieval_options": {
      "boost_by": [
        {
          "field": "timestamp",
          "direction": "desc"
        }
      ],
      "keyword_match_mode": "and"
    },
    "rewrite_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "rewrite_query": true,
    "score_threshold": 0,
    "source": "source",
    "source_params": {
      "exclude_items": [
        "/admin/**",
        "/private/**",
        "**\\temp\\**"
      ],
      "include_items": [
        "/blog/**",
        "/docs/**/*.html",
        "**\\blog\\**.html"
      ],
      "prefix": "prefix",
      "r2_jurisdiction": "r2_jurisdiction",
      "web_crawler": {
        "parse_options": {
          "content_selector": [
            {
              "path": "**/blog/**",
              "selector": "article div.post-body"
            },
            {
              "path": "**/docs/**",
              "selector": "main"
            }
          ],
          "include_headers": {
            "cache-control": "no-cache, no-store"
          },
          "include_images": true,
          "specific_sitemaps": [
            "https://example.com/sitemap.xml",
            "https://example.com/blog-sitemap.xml"
          ],
          "use_browser_rendering": true
        },
        "parse_type": "sitemap"
      }
    },
    "status": "status",
    "sync_interval": 900,
    "token_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "type": "r2"
  },
  "success": true
}
Returns Examples
{
  "result": {
    "id": "my-ai-search",
    "created_at": "2019-12-27T18:11:19.117Z",
    "modified_at": "2019-12-27T18:11:19.117Z",
    "ai_gateway_id": "ai_gateway_id",
    "ai_search_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "cache": true,
    "cache_threshold": "super_strict_match",
    "cache_ttl": 600,
    "chunk_overlap": 0,
    "chunk_size": 64,
    "created_by": "created_by",
    "custom_metadata": [
      {
        "data_type": "text",
        "field_name": "x"
      }
    ],
    "embedding_model": "@cf/qwen/qwen3-embedding-0.6b",
    "enable": true,
    "engine_version": 0,
    "fusion_method": "max",
    "hybrid_search_enabled": true,
    "index_method": {
      "keyword": true,
      "vector": true
    },
    "indexing_options": {
      "keyword_tokenizer": "porter"
    },
    "last_activity": "2019-12-27T18:11:19.117Z",
    "max_num_results": 1,
    "metadata": {
      "created_from_aisearch_wizard": true,
      "worker_domain": "worker_domain"
    },
    "modified_by": "modified_by",
    "namespace": "namespace",
    "paused": true,
    "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,
      "mcp": {
        "description": "description",
        "disabled": true
      },
      "rate_limit": {
        "period_ms": 60000,
        "requests": 1,
        "technique": "fixed"
      },
      "search_endpoint": {
        "disabled": true
      }
    },
    "reranking": true,
    "reranking_model": "@cf/baai/bge-reranker-base",
    "retrieval_options": {
      "boost_by": [
        {
          "field": "timestamp",
          "direction": "desc"
        }
      ],
      "keyword_match_mode": "and"
    },
    "rewrite_model": "@cf/meta/llama-3.3-70b-instruct-fp8-fast",
    "rewrite_query": true,
    "score_threshold": 0,
    "source": "source",
    "source_params": {
      "exclude_items": [
        "/admin/**",
        "/private/**",
        "**\\temp\\**"
      ],
      "include_items": [
        "/blog/**",
        "/docs/**/*.html",
        "**\\blog\\**.html"
      ],
      "prefix": "prefix",
      "r2_jurisdiction": "r2_jurisdiction",
      "web_crawler": {
        "parse_options": {
          "content_selector": [
            {
              "path": "**/blog/**",
              "selector": "article div.post-body"
            },
            {
              "path": "**/docs/**",
              "selector": "main"
            }
          ],
          "include_headers": {
            "cache-control": "no-cache, no-store"
          },
          "include_images": true,
          "specific_sitemaps": [
            "https://example.com/sitemap.xml",
            "https://example.com/blog-sitemap.xml"
          ],
          "use_browser_rendering": true
        },
        "parse_type": "sitemap"
      }
    },
    "status": "status",
    "sync_interval": 900,
    "token_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "type": "r2"
  },
  "success": true
}