> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# SetSeoPattern

# Package: seo

# Namespace: PageTypeSeoPatternsService

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/set-seo-pattern.md

## Permission Scopes:
Manage SEO Settings: SCOPE.PROMOTE.MANAGE-SEO

## Introduction

Changes the pattern a site has for a page type.

Setting `pattern` replaces the page type's tag templates in full, so retrieve the
pattern first and send back the complete set you want it to have. Sending an empty
pattern clears it, which returns the page type to its Wix default.

This method changes a pattern that already exists rather than creating one. For a page
type still on its Wix default, call [Create SEO
Pattern](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/create-seo-pattern.md)
instead.

A pattern has no revision, and the site's SEO settings in the dashboard write to the
same pattern. The last write wins, so retrieve the pattern immediately before writing
it.

---

## REST API

### Schema

```
 Method: setSeoPattern
 Description: Changes the pattern a site has for a page type.  Setting `pattern` replaces the page type's tag templates in full, so retrieve the pattern first and send back the complete set you want it to have. Sending an empty pattern clears it, which returns the page type to its Wix default.  This method changes a pattern that already exists rather than creating one. For a page type still on its Wix default, call [Create SEO Pattern](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/create-seo-pattern.md) instead.  A pattern has no revision, and the site's SEO settings in the dashboard write to the same pattern. The last write wins, so retrieve the pattern immediately before writing it.
 URL: https://www.wixapis.com/seo-metatags-server/v1/seo-patterns/{pageType}
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  seoPattern, fieldMask
 Method parameters: 
   param name: fieldMask | type: fieldMask | description: Fields to update.  Supported properties: `pattern`  Over REST, send the mask as a comma-separated string, for example `"fieldMask": "pattern"`. The JavaScript SDK takes an array of strings instead, for example `fieldMask: ["pattern"]`. | required: true 
   param name: pageId | type: pageId | description: GUID of a single page built from a Wix Data collection, to change the pattern of that page alone.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
   param name: seoPattern | type: SeoPattern | description: An SEO pattern is a template of SEO tags defined for one page type, such as every blog post or every store product. A pattern's tags may contain variables, written as `{{variable}}`, that are filled in with each item's own values when its page renders, so a Wix user sets the tags for a whole page type once instead of item by item.  Every page type always has a pattern in effect. When a site has no pattern of its own for a page type, the built-in Wix default applies, and `source` reports which of the two is in effect.  A change to a pattern reaches the live site without a site publish, and applies to every page of that type that has no SEO tags set for the item itself. | required: true 
        - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, when the pattern applies to that page alone rather than to the whole page type.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
        - name: pattern | type: SeoPatternBlob | description: The site's own pattern for the page type, which takes precedence over the Wix default.  Empty when the site has no pattern of its own, in which case `defaultPattern` applies.  
           - name: tags | type: array<Tag> | description: The pattern's SEO tag templates.  A tag may reference only the variables the page type offers. Call [List SEO Pattern Variables](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/list-seo-pattern-variables.md) for the page type to retrieve them.  A tag whose `disabled` or `custom` value is itself a variable is returned with that value unset, because those fields are booleans. The behavior still applies when the page renders.  Each tag can be up to 4,096 bytes, measured as its serialized JSON. A structured-data tag (`script` with `props.type` set to `application/ld+json`) can hold up to 12,000 characters of JSON-LD, and all structured data in one list up to 409,600 bytes. A tag over its limit fails with `INVALID_PATTERN`.  | validation: maxItems 100
              - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.  
              - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.  
              - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.  
              - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.  
              - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.  
              - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.  
 Return type: SetSeoPatternResponse
  - name: seoPattern | type: SeoPattern | description: The updated pattern.  
     - name: id | type: string | description: SEO pattern GUID, in the format `{pageType}`.  For a pattern that applies to a single page built from a Wix Data collection, the format is `{pageType}:{pageId}`.  | read-only: true | validation: maxLength 400
     - name: pageType | type: string | description: Page type the pattern applies to. A known page type name, such as `STATIC_PAGE`, `BLOG_POST`, or `STORES_PRODUCT`.  See the list of [common page types](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/introduction.md#page-types).  | read-only: true | validation: maxLength 100
     - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, when the pattern applies to that page alone rather than to the whole page type.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
     - name: pattern | type: SeoPatternBlob | description: The site's own pattern for the page type, which takes precedence over the Wix default.  Empty when the site has no pattern of its own, in which case `defaultPattern` applies.  
        - name: tags | type: array<Tag> | description: The pattern's SEO tag templates.  A tag may reference only the variables the page type offers. Call [List SEO Pattern Variables](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/list-seo-pattern-variables.md) for the page type to retrieve them.  A tag whose `disabled` or `custom` value is itself a variable is returned with that value unset, because those fields are booleans. The behavior still applies when the page renders.  Each tag can be up to 4,096 bytes, measured as its serialized JSON. A structured-data tag (`script` with `props.type` set to `application/ld+json`) can hold up to 12,000 characters of JSON-LD, and all structured data in one list up to 409,600 bytes. A tag over its limit fails with `INVALID_PATTERN`.  | validation: maxItems 100
           - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.  
           - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.  
           - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.  
           - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.  
           - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.  
           - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.  
     - name: defaultPattern | type: SeoPatternBlob | description: The pattern Wix provides for the page type, which applies whenever the site has no pattern of its own.  Always returned, so you can see what a reset would restore.  | read-only: true 
     - name: source | type: PatternSource | description: Which pattern is in effect for the page type: the site's own, or the Wix default.  | read-only: true 
         - enum:
         -     PATTERN_SOURCE_UNSPECIFIED: Unknown source.
         -     PATTERN_SOURCE_USER: The site has a pattern of its own for the page type, returned in `pattern`.
         -     PATTERN_SOURCE_DEFAULT: The site has no pattern of its own for the page type, so the Wix default in `defaultPattern` applies.
     - name: language | type: string | description: Language the pattern applies to, as an IETF BCP 47 language tag. For example, `en-US` for U.S. English.  A page type has a single pattern, so this reports the site's primary language.  | read-only: true | validation: maxLength 100
     - name: origin | type: Origin | description: What made the most recent change to the pattern, for example a Wix user or the site migration flow. Derived from the caller, not from the request.  Reported only on the response to a write, and on the event the write emits. It isn't stored with the pattern, so Get SEO Pattern and List SEO Patterns always report `ORIGIN_UNSPECIFIED`, as does a write by a caller Wix doesn't identify as a specific origin.  | read-only: true 
         - enum:
         -     ORIGIN_UNSPECIFIED: Unknown origin. Returned by read methods, because origin isn't stored alongside the data it describes.
         -     ORIGIN_USER: A user, working in the dashboard or editor, or calling the API on their own behalf.
         -     ORIGIN_MIGRATION: The flow that imports an existing site into Wix.
         -     ORIGIN_AI: An AI agent or an automated suggestion flow.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: COLLECTION_NAME_NOT_SUPPORTED | Description: A `collectionName` was specified. Resolving a dynamic page by collection isn't supported yet, so specify the page's GUID in `pageId` instead.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PAGE_ID_NOT_SUPPORTED | Description: A `pageId` was specified for a page type that has a single pattern for the whole type. Only `WIX_DATA_PAGE_ITEM` supports a per-page pattern.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_FIELD_MASK | Description: The `fieldMask` is empty, or names a field that doesn't exist or isn't writable.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_PATTERN | Description: The pattern references a variable the page type doesn't offer, or contains a tag that isn't valid. When a variable is the problem, the error message lists the variables the page type offers. When a tag is the problem, such as a tag over its size limit, the message names the first few invalid tags and what's wrong with each, and `description` lists every problem as a JSON array.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: UNSUPPORTED_PAGE_TYPE | Description: Wix doesn't recognize the specified `pageType`. The error message lists the page types that are supported.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PATTERN_NOT_FOUND | Description: Couldn't find the pattern. The site has no pattern of its own for this page type, so call Create SEO Pattern instead.


```

### Examples

### Change a page type's pattern
The request carries every tag the pattern should keep, not only the changed title, because the tags sent replace the pattern in full.

```curl
curl -X PATCH \
'https://www.wixapis.com/promote/seo/v1/seo-patterns/STATIC_PAGE' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "seoPattern": {
    "pattern": {
      "tags": [
        {
          "type": "title",
          "children": "{{page.name}} | {{site.business.name}}"
        },
        {
          "type": "meta",
          "props": {
            "name": "description",
            "content": "{{page.name}} at {{site.business.name}}."
          }
        },
        {
          "type": "link",
          "props": {
            "rel": "canonical",
            "href": "{{page.url}}"
          }
        }
      ]
    }
  },
  "fieldMask": "pattern"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.seo.seoPatterns.setSeoPattern(pageType, seoPattern, options)
 Description: Changes the pattern a site has for a page type.  Setting `pattern` replaces the page type's tag templates in full, so retrieve the pattern first and send back the complete set you want it to have. Sending an empty pattern clears it, which returns the page type to its Wix default.  This method changes a pattern that already exists rather than creating one. For a page type still on its Wix default, call [Create SEO Pattern](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/create-seo-pattern.md) instead.  A pattern has no revision, and the site's SEO settings in the dashboard write to the same pattern. The last write wins, so retrieve the pattern immediately before writing it.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  pageType, seoPattern, options.fieldMask, options
 Method parameters: 
   param name: pageType | type: string | description: Page type whose pattern to change. Send a known page type name, such as `STATIC_PAGE`, `BLOG_POST`, or `STORES_PRODUCT`.  An unknown name fails with `UNSUPPORTED_PAGE_TYPE`.  See the list of [common page types](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/introduction.md#page-types). | required: true | validation: maxLength 100
   param name: seoPattern | type: SetSeoPattern | description: An SEO pattern is a template of SEO tags defined for one page type, such as every blog post or every store product. A pattern's tags may contain variables, written as `{{variable}}`, that are filled in with each item's own values when its page renders, so a Wix user sets the tags for a whole page type once instead of item by item.  Every page type always has a pattern in effect. When a site has no pattern of its own for a page type, the built-in Wix default applies, and `source` reports which of the two is in effect.  A change to a pattern reaches the live site without a site publish, and applies to every page of that type that has no SEO tags set for the item itself. | required: true 
        - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, when the pattern applies to that page alone rather than to the whole page type.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
        - name: pattern | type: SeoPatternBlob | description: The site's own pattern for the page type, which takes precedence over the Wix default.  Empty when the site has no pattern of its own, in which case `defaultPattern` applies.  
           - name: tags | type: array<Tag> | description: The pattern's SEO tag templates.  A tag may reference only the variables the page type offers. Call [List SEO Pattern Variables](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/list-seo-pattern-variables.md) for the page type to retrieve them.  A tag whose `disabled` or `custom` value is itself a variable is returned with that value unset, because those fields are booleans. The behavior still applies when the page renders.  Each tag can be up to 4,096 bytes, measured as its serialized JSON. A structured-data tag (`script` with `props.type` set to `application/ld+json`) can hold up to 12,000 characters of JSON-LD, and all structured data in one list up to 409,600 bytes. A tag over its limit fails with `INVALID_PATTERN`.  | validation: maxItems 100
              - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.  
              - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.  
              - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.  
              - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.  
              - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.  
              - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.  
   param name: options | type: SetSeoPatternOptions  none | required: true 
        - name: fieldMask | type: array<string> | description: Fields to update.  Supported properties: `pattern`  Over REST, send the mask as a comma-separated string, for example `"fieldMask": "pattern"`. The JavaScript SDK takes an array of strings instead, for example `fieldMask: ["pattern"]`. | required: true 
        - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, to change the pattern of that page alone.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
 Return type: PROMISE<SetSeoPatternResponse>
  - name: seoPattern | type: SeoPattern | description: The updated pattern.  
     - name: _id | type: string | description: SEO pattern GUID, in the format `{pageType}`.  For a pattern that applies to a single page built from a Wix Data collection, the format is `{pageType}:{pageId}`.  | read-only: true | validation: maxLength 400
     - name: pageType | type: string | description: Page type the pattern applies to. A known page type name, such as `STATIC_PAGE`, `BLOG_POST`, or `STORES_PRODUCT`.  See the list of [common page types](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/introduction.md#page-types).  | read-only: true | validation: maxLength 100
     - name: pageId | type: string | description: GUID of a single page built from a Wix Data collection, when the pattern applies to that page alone rather than to the whole page type.  Supported only for the `WIX_DATA_PAGE_ITEM` page type.  | validation: maxLength 200
     - name: pattern | type: SeoPatternBlob | description: The site's own pattern for the page type, which takes precedence over the Wix default.  Empty when the site has no pattern of its own, in which case `defaultPattern` applies.  
        - name: tags | type: array<Tag> | description: The pattern's SEO tag templates.  A tag may reference only the variables the page type offers. Call [List SEO Pattern Variables](https://dev.wix.com/docs/api-reference/business-management/seo/seo-pattern-v1/list-seo-pattern-variables.md) for the page type to retrieve them.  A tag whose `disabled` or `custom` value is itself a variable is returned with that value unset, because those fields are booleans. The behavior still applies when the page renders.  Each tag can be up to 4,096 bytes, measured as its serialized JSON. A structured-data tag (`script` with `props.type` set to `application/ld+json`) can hold up to 12,000 characters of JSON-LD, and all structured data in one list up to 409,600 bytes. A tag over its limit fails with `INVALID_PATTERN`.  | validation: maxItems 100
           - name: type | type: string | description: Legacy. Was a free-form string: "title" | "meta" | "script" | "link". The typed replacement is the `kind` oneof on `SeoSchemaV2.Tag`, which makes the invalid combinations unrepresentable rather than merely discouraged.  Which of these an API actually accepts depends on where the tag is being set: this list is not a blanket guarantee across every API that reuses this message. Site SEO Tags in particular accepts only `meta` (see `SiteSeoTags.tags`) and rejects `title`/`script`/`link` with a validation error even though they appear here — check the field description of the specific `tags`-typed field you are writing to.  Limitation: `title` and `script` (e.g. a `script` tag with `props.type` "application/ld+json" carrying structured data) are supported only when `custom` is unset or `false`. Setting `custom: true` on a `title` or `script` tag is rejected with `TAG_TYPE_NOT_ALLOWED`, because `custom: true` routes the write through the site's Advanced/Custom Tags list. To write structured data, omit `custom` (or set it to `false`).  No length limit: this field holds data written years ago by writers we are not migrating. A constraint here could reject a record that is already stored, which is exactly the promise this design makes.  
           - name: props | type: object | description: Legacy. Was an untyped bag of HTML attributes. Typed replacement: `SeoSchemaV2.TitleTag` / `MetaTag` / `LinkTag`.  
           - name: meta | type: object | description: Legacy. Was an untyped bag of 16 mixed-purpose keys. In `SeoSchemaV2` its contents are split by purpose: per-page structured-data state moves to StructuredDataTag, authorship to `written_by`, and render-time preset logic (variants, enabledByExperiment, removeSchemaIf*) moved out of the stored document entirely — it belongs to the preset definition, not to the page. See the design log for the full key-by-key mapping.  
           - name: children | type: string | description: Legacy. Was the tag's inner content, doubling as the JSON-LD payload for script tags. Typed replacement: `SeoSchemaV2.TitleTag.text` and `StructuredDataTag.json_ld`. No length limit, for the same reason as `type` above.  
           - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages) — i.e. an entry from the site's Advanced/Custom Tags list.  Setting this to `true` on a write restricts which `type` values are accepted — the same restriction the Advanced/Custom Tags UI enforces. `title` and `script` tags (including JSON-LD structured data) must be sent with `custom` omitted or `false`; sending them with `custom: true` is rejected with `TAG_TYPE_NOT_ALLOWED`.  Note this is a separate restriction from Site SEO Tags' own type restriction on `SiteSeoTags.tags`: even with `custom` unset, Site SEO Tags rejects `script` (e.g. for site-wide structured data) unconditionally. There is currently no way to set site-wide, every-page structured data through any of these APIs — write a per-page `script` tag through the Item SEO Tags API instead.  This flag is scoped to that feature only. It is NOT an indicator of whether a standard tag (`title`, `description`, Open Graph, etc.) reflects a manually configured value versus a computed default/pattern — standard tags always resolve with `custom: false`, even when their content comes from a page's manually saved SEO title/description override. Don't use this field to verify whether a live page reflects a manual per-page SEO edit.  Limitation: when `ResolveStaticPageSeoTags` is called without `seoData`, the per-page SEO data is read only from the Vibe/Wix-managed-headless override store. That store holds nothing for classic Wix Editor or Wix Studio pages, so even genuine Advanced/Custom Tags saved on those pages are missing from the response entirely — there, `false` means this API could not tell, not that no custom tag exists. Pass `seoData` explicitly to resolve against a known set of tags.  `SeoSchemaV2.Tag` expresses this as `written_by = USER_CUSTOM`.  
           - name: disabled | type: boolean | description: Whether the tag is excluded from the rendered <head>.  A disabled tag is still stored, so the user can re-enable it and so a pattern-provided tag stays suppressed on this page. Default false.  
     - name: defaultPattern | type: SeoPatternBlob | description: The pattern Wix provides for the page type, which applies whenever the site has no pattern of its own.  Always returned, so you can see what a reset would restore.  | read-only: true 
     - name: source | type: PatternSource | description: Which pattern is in effect for the page type: the site's own, or the Wix default.  | read-only: true 
         - enum:
         -     PATTERN_SOURCE_UNSPECIFIED: Unknown source.
         -     PATTERN_SOURCE_USER: The site has a pattern of its own for the page type, returned in `pattern`.
         -     PATTERN_SOURCE_DEFAULT: The site has no pattern of its own for the page type, so the Wix default in `defaultPattern` applies.
     - name: language | type: string | description: Language the pattern applies to, as an IETF BCP 47 language tag. For example, `en-US` for U.S. English.  A page type has a single pattern, so this reports the site's primary language.  | read-only: true | validation: maxLength 100
     - name: origin | type: Origin | description: What made the most recent change to the pattern, for example a Wix user or the site migration flow. Derived from the caller, not from the request.  Reported only on the response to a write, and on the event the write emits. It isn't stored with the pattern, so Get SEO Pattern and List SEO Patterns always report `ORIGIN_UNSPECIFIED`, as does a write by a caller Wix doesn't identify as a specific origin.  | read-only: true 
         - enum:
         -     ORIGIN_UNSPECIFIED: Unknown origin. Returned by read methods, because origin isn't stored alongside the data it describes.
         -     ORIGIN_USER: A user, working in the dashboard or editor, or calling the API on their own behalf.
         -     ORIGIN_MIGRATION: The flow that imports an existing site into Wix.
         -     ORIGIN_AI: An AI agent or an automated suggestion flow.

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: COLLECTION_NAME_NOT_SUPPORTED | Description: A `collectionName` was specified. Resolving a dynamic page by collection isn't supported yet, so specify the page's GUID in `pageId` instead.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: PAGE_ID_NOT_SUPPORTED | Description: A `pageId` was specified for a page type that has a single pattern for the whole type. Only `WIX_DATA_PAGE_ITEM` supports a per-page pattern.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_FIELD_MASK | Description: The `fieldMask` is empty, or names a field that doesn't exist or isn't writable.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: INVALID_PATTERN | Description: The pattern references a variable the page type doesn't offer, or contains a tag that isn't valid. When a variable is the problem, the error message lists the variables the page type offers. When a tag is the problem, such as a tag over its size limit, the message names the first few invalid tags and what's wrong with each, and `description` lists every problem as a JSON array.
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: UNSUPPORTED_PAGE_TYPE | Description: Wix doesn't recognize the specified `pageType`. The error message lists the page types that are supported.
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: PATTERN_NOT_FOUND | Description: Couldn't find the pattern. The site has no pattern of its own for this page type, so call Create SEO Pattern instead.


```

### Examples

### Change a page type's pattern
The tags sent replace the pattern in full, so this call carries every tag the pattern should keep, not only the changed title.

```javascript
import { seoPatterns } from "@wix/seo";

async function setSeoPattern() {
  const response = await seoPatterns.setSeoPattern(
    "STATIC_PAGE",
    {
      pattern: {
        tags: [
          {
            type: "title",
            children: "{{page.name}} | {{site.business.name}}",
          },
          {
            type: "meta",
            props: {
              name: "description",
              content: "{{page.name}} at {{site.business.name}}.",
            },
          },
          {
            type: "link",
            props: { rel: "canonical", href: "{{page.url}}" },
          },
        ],
      },
    },
    { fieldMask: ["pattern"] },
  );
  return response;
}

/* Promise resolves to:
 * {
 *   "seoPattern": {
 *     "pageType": "STATIC_PAGE",
 *     "pattern": {
 *       "tags": [
 *         {
 *           "type": "title",
 *           "children": "{{page.name}} | {{site.business.name}}",
 *           "custom": false,
 *           "disabled": false
 *         },
 *         {
 *           "type": "meta",
 *           "props": { "name": "description", "content": "{{page.name}} at {{site.business.name}}." },
 *           "children": "",
 *           "custom": false,
 *           "disabled": false
 *         },
 *         {
 *           "type": "link",
 *           "props": { "rel": "canonical", "href": "{{page.url}}" },
 *           "children": "",
 *           "custom": false,
 *           "disabled": false
 *         }
 *       ]
 *     },
 *     "defaultPattern": {
 *       "tags": [
 *         {
 *           "type": "title",
 *           "children": "{{page.name}} | {{site.name}}",
 *           "custom": false,
 *           "disabled": false
 *         }
 *       ]
 *     },
 *     "source": "PATTERN_SOURCE_USER",
 *     "origin": "ORIGIN_UNSPECIFIED",
 *     "_id": "STATIC_PAGE"
 *   }
 * }
 */

```

### setSeoPattern (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { seoPatterns } from '@wix/seo';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { seoPatterns },
  // Include the auth strategy and host as relevant
});


async function setSeoPattern(pageType,seoPattern,options) {
  const response = await myWixClient.seoPatterns.setSeoPattern(pageType,seoPattern,options);
};
```

---