> 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`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpdateLlmsTxt

# Package: txtFileServer

# Namespace: LlmsServiceV2

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/seo/txt-file-server/llms-txt/update-llms-txt.md

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

## Introduction

Updates the `llms.txt` file entity.

The content can be set to an empty string to create a blank file.

To restore Wix's default content, set the `default` field to `true` and omit the `content` field.

---

## REST API

### Schema

```
 Method: updateLlmsTxt
 Description: Updates the `llms.txt` file entity.  The content can be set to an empty string to create a blank file.  To restore Wix's default content, set the `default` field to `true` and omit the `content` field.
 URL: https://www.wixapis.com/promote-seo-robots-server/v2/llms
 Method: PUT
 Method parameters:
   param name: llmsTxt | type: LlmsTxt    
        - name: content | type: string | description: CFull text content of the `llms.txt` file.  | validation: maxLength 720000
        - name: default | type: boolean | description: Whether this `llms.txt` file uses Wix's default content.  
        - name: subdomain | type: string | description: Target subdomain for the `llms.txt` file (for example, 'www', 'es', 'fr'). Default: 'www'  | validation: maxLength 63
        - name: manuallyEdited | type: boolean | description: Whether the content was manually edited by the user. If `true` in DB, update/append requests must also set `manually_edited=true` or they'll be rejected with `FAILED_PRECONDITION`.  
        - name: detectedLanguage | type: string | description: ISO 639-1 language code detected for the site (e.g. en, fr). Used to localize the MCP documentation section when serving llms.txt.  | validation: maxLength 2
 Return type: UpdateLlmsTxtResponse
  - name: llmsTxt | type: LlmsTxt | description: Updated Llms txt object  
     - name: content | type: string | description: CFull text content of the `llms.txt` file.  | validation: maxLength 720000
     - name: default | type: boolean | description: Whether this `llms.txt` file uses Wix's default content.  
     - name: subdomain | type: string | description: Target subdomain for the `llms.txt` file (for example, 'www', 'es', 'fr'). Default: 'www'  | validation: maxLength 63
     - name: hidden | type: boolean | description: Whether the llms.txt file should be hidden from public access.  
     - name: manuallyEdited | type: boolean | description: Whether the content was manually edited by the user. If `true` in DB, update/append requests must also set `manually_edited=true` or they'll be rejected with `FAILED_PRECONDITION`.  
     - name: detectedLanguage | type: string | description: ISO 639-1 language code detected for the site (e.g. en, fr). Used to localize the MCP documentation section when serving llms.txt.  | validation: maxLength 2

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code:  | Description: Site GUID is missing.


```

### Examples

### Update llms.txt
```curl
curl -X PUT https://www.wixapis.com/promote-seo-txt-file-server/v2/llms \
    -H 'Content-Type: application/json;charset=UTF-8' \
    -H 'Authorization: <AUTH>' \
    -d '{
        "llmsTxt": {
            "content": "# My Site\n\n> Custom guidance for AI tools.\n\n## Public pages\n- https://www.example.com/about",
            "default": false,
            "manuallyEdited": true,
            "subdomain": "www"
        }
    }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.seo.llmsTxt.updateLlmsTxt(options)
 Description: Updates the `llms.txt` file entity.  The content can be set to an empty string to create a blank file.  To restore Wix's default content, set the `default` field to `true` and omit the `content` field.
 Method parameters:
   param name: options | type: UpdateLlmsTxtOptions  none  
        - name: llmsTxt | type: LlmsTxt | description: `llms.txt` file to update.  
           - name: content | type: string | description: CFull text content of the `llms.txt` file.  | validation: maxLength 720000
           - name: default | type: boolean | description: Whether this `llms.txt` file uses Wix's default content.  
           - name: subdomain | type: string | description: Target subdomain for the `llms.txt` file (for example, 'www', 'es', 'fr'). Default: 'www'  | validation: maxLength 63
           - name: manuallyEdited | type: boolean | description: Whether the content was manually edited by the user. If `true` in DB, update/append requests must also set `manually_edited=true` or they'll be rejected with `FAILED_PRECONDITION`.  
           - name: detectedLanguage | type: string | description: ISO 639-1 language code detected for the site (e.g. en, fr). Used to localize the MCP documentation section when serving llms.txt.  | validation: maxLength 2
 Return type: PROMISE<UpdateLlmsTxtResponse>
  - name: llmsTxt | type: LlmsTxt | description: Updated Llms txt object  
     - name: content | type: string | description: CFull text content of the `llms.txt` file.  | validation: maxLength 720000
     - name: default | type: boolean | description: Whether this `llms.txt` file uses Wix's default content.  
     - name: subdomain | type: string | description: Target subdomain for the `llms.txt` file (for example, 'www', 'es', 'fr'). Default: 'www'  | validation: maxLength 63
     - name: hidden | type: boolean | description: Whether the llms.txt file should be hidden from public access.  
     - name: manuallyEdited | type: boolean | description: Whether the content was manually edited by the user. If `true` in DB, update/append requests must also set `manually_edited=true` or they'll be rejected with `FAILED_PRECONDITION`.  
     - name: detectedLanguage | type: string | description: ISO 639-1 language code detected for the site (e.g. en, fr). Used to localize the MCP documentation section when serving llms.txt.  | validation: maxLength 2

 Possible Errors:
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code:  | Description: Site GUID is missing.


```

### Examples

### updateLlmsTxt
```javascript
import { llmsTxt } from '@wix/seo';

async function updateLlmsTxt(options) {
  const response = await llmsTxt.updateLlmsTxt(options);
};
```

### updateLlmsTxt (with elevated permissions)
```javascript
import { llmsTxt } from '@wix/seo';
import { auth } from '@wix/essentials';

async function myUpdateLlmsTxtMethod(options) {
  const elevatedUpdateLlmsTxt = auth.elevate(llmsTxt.updateLlmsTxt);
  const response = await elevatedUpdateLlmsTxt(options);
}
```

### updateLlmsTxt (self-hosted)
Self-hosted 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 { llmsTxt } from '@wix/seo';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function updateLlmsTxt(options) {
  const response = await myWixClient.llmsTxt.updateLlmsTxt(options);
};
```

---