> 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

# QuerySchemas

# Package: translation

# Namespace: TranslationSchema

# Method link: https://dev.wix.com/docs/api-reference/business-management/multilingual/translation/translation-schema/query-schemas?apiView=SDK.md

## Permission Scopes:
Wix Multilingual - Translation Schema Read: SCOPE.DC-MULTILINGUAL.READ_TRANSLATION_SCHEMA

## Introduction

Retrieves a list of schemas, given the provided paging, filtering, and sorting. Up to 100 schemas can be returned per request.

> **Note:**
>
> This method can retrieve all schemas with a `GLOBAL` scope and schemas with a `SITE` scope for the site the API request is authorized to access.

The default `sort` is `id` in `ASC`.

To learn how to query translation schemas, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md).

---

## REST API

### Schema

```
 Method: querySchemas
 Description: Retrieves a list of schemas, given the provided paging, filtering, and sorting. Up to 100 schemas can be returned per request.  > **Note:** > > This method can retrieve all schemas with a `GLOBAL` scope and schemas with a `SITE` scope for the site the API request is authorized to access.  The default `sort` is `id` in `ASC`.  To learn how to query translation schemas, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md).
 URL: https://www.wixapis.com/translation-schema/v1/schemas/query
 Method: POST
 Method parameters:
   param name: query | type: CursorQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: key.appId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: key.entityType | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: key.scope | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: hidden | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: parentId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: QuerySchemasResponse
  - name: schemas | type: array<Schema> | description: List of translation schemas.  
     - name: id | type: string | description: Translation schema GUID.  | read-only: true | validation: format GUID
     - name: key | type: SchemaKey | description: Translation schema unique key identifier.  
        - name: appId | type: string | description: GUID of the app that created the schema.  | read-only: true | validation: format GUID
        - name: entityType | type: string | description: A unique name defined by the app developer to differentiate translation schemas for various entities within their app. For example, if an app developer is creating a translation schema for blog posts, the `entityType` can be `'blog-posts'`.  | validation: minLength 1, maxLength 100, immutable
        - name: scope | type: SchemaScope | description: Scope of the translation schema.  | validation: immutable
             - enum:
             -     GLOBAL: Global schema for all sites.
             -     SITE: Custom schema for a specific site.
     - name: fields | type: Map<string,SchemaField> | description: List of fields for the translation schema. This property uses a string to map to a `SchemaField` (`Map<string, SchemaField>`). The string serves as a key, which you'll need to access each field in the schema and when adding translation content.  | validation: minItems 1, maxItems 1000, format map
        - name: id | type: string | description: Field GUID. Validated according to Regex `^[A-Za-z0-9-_)(]+$`. Field GUIDs may contain parentheses to reference repeated items, such as images. These parentheses can't be nested and each opening parenthesis must be followed by a closing one. For example, `title()()` is valid, while `title)(` and `title(())` aren't valid. The value inside the parenthesis is validated according to Regex `^[^)(\\]\\[\\.]+$`.  | read-only: true | validation: minLength 1, maxLength 1000
        - name: type | type: FieldType | description: **Required.** Field type.  
             - enum:
             -     SHORT_TEXT: Short plain text displayed as a single line in the UI.
             -     LONG_TEXT: Long plain text displayed as multiple lines in the UI.
             -     HTML: Long text including styles, images, and links.
             -     RICH_CONTENT: Rich-Content using the Wix Ricos format.
             -     IMAGE: Wix Media Manager image.
             -     IMAGE_LINK: Image URL without metadata.
             -     VIDEO: Wix Media Manager video.
             -     DOCUMENT: Wix Media Manager document.
        - name: displayName | type: string | description: Field name displayed in the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager).  | validation: maxLength 1000
        - name: groupName | type: string | description: Field group name.  | validation: maxLength 1000
        - name: minLength | type: integer | description: Field minimum text length.  | validation: minimum 1, format int32
        - name: maxLength | type: integer | description: Field maximum text length.  | validation: minimum 1, format int32
        - name: format | type: string | description: Field format. Content is validated based on the format set here in the field schema. For example, if the format is `EMAIL`, then the content for this field must be a valid email address.  | validation: minLength 2, maxLength 20
        - name: hidden | type: boolean | description: Whether the field is hidden from the site. Hidden fields are still validated.  
        - name: displayOnly | type: boolean | description: Whether the field is read-only, and not intended to be translated. For example, an image. Use this field when you want an image to remain in the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager) for context, but without being translated.  
        - name: index | type: number | description: Field index. Use for cases where the order of the fields are relevant.  | validation: minimum 0, format double
     - name: previewFields | type: PreviewFields | description: Fields displayed in content previews. For example, a product name for a product translation schema.  
        - name: titleFieldId | type: string | description: GUID of the field representing the schema's title.  | validation: maxLength 1000
        - name: imageFieldId | type: string | description: GUID of the field representing the schema's image.  | validation: maxLength 1000
     - name: hidden | type: boolean | description: Whether the translation schema is hidden from the site.  Default: `false`  
     - name: displayName | type: string | description: Translation schema name displayed in the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager).  | validation: maxLength 100
     - name: parentId | type: string | description: A reference to the parent schema. For example, if the schema is for a menu item, this property would contain the schema GUID of the menu it belongs to.  Required when `require_parent_entity` is set to `true`.  | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the schema is updated. To prevent conflicting changes, the existing `revision` must be used when updating a schema.  | read-only: true | validation: format int64
     - name: createdDate | type: string | description: Date and time the translation schema was created.  | read-only: true | validation: format date-time
     - name: updatedDate | type: string | description: Date and time the translation schema was updated.  | read-only: true | validation: format date-time
     - name: duplicateContent | type: boolean | description: Whether to duplicate the translated content when a site containing the translation schema and content is duplicated.  Default: `false`  
     - name: schemaGroupId | type: string | description: Indicate if this schema should be grouped under a custom group in the Translation Manager For more info about this field check dev-center extension `Multilingual Schema Group`  | validation: format GUID
     - name: requireParentEntity | type: boolean | description: Whether content created or updated with this schema must include a `parent_entity_id`. When set to `true`, any Create Content or Update Content call targeting this schema will fail if `parent_entity_id` is missing or empty.  The schema itself must also have a `parent_id` defined, otherwise the schema Create or Update call will fail with `SchemaRequireParentEntityWithoutParentIdException`.  Default: `false`  Example: A "menu-item" schema that always belongs to a "menu" parent schema would set `require_parent_entity = true` and `parent_id` to the "menu" schema GUID. Every translation content item created for "menu-item" must then specify which menu it belongs to via `parent_entity_id`.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata for the next page of results.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### Query Schema
```curl
curl -X POST \
  'https://www.wixapis.com/translation-schema/v1/schemas/query' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "query": {
      "filter": {
        "key.appId": "4ad2dfe1-a943-45a8-94ac-f1dd8b78821b"
      }
    }
  }'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.multilingual.translationSchemas.querySchemas(query)
 Description: Retrieves a list of schemas, given the provided paging, filtering, and sorting. Up to 100 schemas can be returned per request.  > **Note:** > > This method can retrieve all schemas with a `GLOBAL` scope and schemas with a `SITE` scope for the site the API request is authorized to access.  The default `sort` is `id` in `ASC`.  To learn how to query translation schemas, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md).
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  query
 Method parameters: 
   param name: query | type: SchemaQuery   | required: true 
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
 Query fields:
   - field: _id | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: hidden | operators: $eq, $ne, $in, $exists | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
   - field: parentId | operators: $eq, $ne, $in, $exists, $gt, $gte, $lt, $lte, $startsWith | sort: ASC, DESC | aggregatable: undefined | searchable: undefined
 Return type: PROMISE<QuerySchemasResponse>
  - name: schemas | type: array<Schema> | description: List of translation schemas.  
     - name: _id | type: string | description: Translation schema GUID.  | read-only: true | validation: format GUID
     - name: key | type: SchemaKey | description: Translation schema unique key identifier.  
        - name: appId | type: string | description: GUID of the app that created the schema.  | read-only: true | validation: format GUID
        - name: entityType | type: string | description: A unique name defined by the app developer to differentiate translation schemas for various entities within their app. For example, if an app developer is creating a translation schema for blog posts, the `entityType` can be `'blog-posts'`.  | validation: minLength 1, maxLength 100, immutable
        - name: scope | type: SchemaScope | description: Scope of the translation schema.  | validation: immutable
             - enum:
             -     GLOBAL: Global schema for all sites.
             -     SITE: Custom schema for a specific site.
     - name: fields | type: Map<string,SchemaField> | description: List of fields for the translation schema. This property uses a string to map to a `SchemaField` (`Map<string, SchemaField>`). The string serves as a key, which you'll need to access each field in the schema and when adding translation content.  | validation: minItems 1, maxItems 1000, format map
        - name: _id | type: string | description: Field GUID. Validated according to Regex `^[A-Za-z0-9-_)(]+$`. Field GUIDs may contain parentheses to reference repeated items, such as images. These parentheses can't be nested and each opening parenthesis must be followed by a closing one. For example, `title()()` is valid, while `title)(` and `title(())` aren't valid. The value inside the parenthesis is validated according to Regex `^[^)(\\]\\[\\.]+$`.  | read-only: true | validation: minLength 1, maxLength 1000
        - name: type | type: FieldType | description: **Required.** Field type.  
             - enum:
             -     SHORT_TEXT: Short plain text displayed as a single line in the UI.
             -     LONG_TEXT: Long plain text displayed as multiple lines in the UI.
             -     HTML: Long text including styles, images, and links.
             -     RICH_CONTENT: Rich-Content using the Wix Ricos format.
             -     IMAGE: Wix Media Manager image.
             -     IMAGE_LINK: Image URL without metadata.
             -     VIDEO: Wix Media Manager video.
             -     DOCUMENT: Wix Media Manager document.
        - name: displayName | type: string | description: Field name displayed in the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager).  | validation: maxLength 1000
        - name: groupName | type: string | description: Field group name.  | validation: maxLength 1000
        - name: minLength | type: integer | description: Field minimum text length.  | validation: minimum 1, format int32
        - name: maxLength | type: integer | description: Field maximum text length.  | validation: minimum 1, format int32
        - name: format | type: string | description: Field format. Content is validated based on the format set here in the field schema. For example, if the format is `EMAIL`, then the content for this field must be a valid email address.  | validation: minLength 2, maxLength 20
        - name: hidden | type: boolean | description: Whether the field is hidden from the site. Hidden fields are still validated.  
        - name: displayOnly | type: boolean | description: Whether the field is read-only, and not intended to be translated. For example, an image. Use this field when you want an image to remain in the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager) for context, but without being translated.  
        - name: index | type: number | description: Field index. Use for cases where the order of the fields are relevant.  | validation: minimum 0
     - name: previewFields | type: PreviewFields | description: Fields displayed in content previews. For example, a product name for a product translation schema.  
        - name: titleFieldId | type: string | description: GUID of the field representing the schema's title.  | validation: maxLength 1000
        - name: imageFieldId | type: string | description: GUID of the field representing the schema's image.  | validation: maxLength 1000
     - name: hidden | type: boolean | description: Whether the translation schema is hidden from the site.  Default: `false`  
     - name: displayName | type: string | description: Translation schema name displayed in the [Translation Manager](https://support.wix.com/en/article/wix-multilingual-using-the-translation-manager).  | validation: maxLength 100
     - name: parentId | type: string | description: A reference to the parent schema. For example, if the schema is for a menu item, this property would contain the schema GUID of the menu it belongs to.  Required when `require_parent_entity` is set to `true`.  | validation: format GUID
     - name: revision | type: string | description: Revision number, which increments by 1 each time the schema is updated. To prevent conflicting changes, the existing `revision` must be used when updating a schema.  | read-only: true | validation: format int64
     - name: _createdDate | type: Date | description: Date and time the translation schema was created.  | read-only: true 
     - name: _updatedDate | type: Date | description: Date and time the translation schema was updated.  | read-only: true 
     - name: duplicateContent | type: boolean | description: Whether to duplicate the translated content when a site containing the translation schema and content is duplicated.  Default: `false`  
     - name: schemaGroupId | type: string | description: Indicate if this schema should be grouped under a custom group in the Translation Manager For more info about this field check dev-center extension `Multilingual Schema Group`  | validation: format GUID
     - name: requireParentEntity | type: boolean | description: Whether content created or updated with this schema must include a `parent_entity_id`. When set to `true`, any Create Content or Update Content call targeting this schema will fail if `parent_entity_id` is missing or empty.  The schema itself must also have a `parent_id` defined, otherwise the schema Create or Update call will fail with `SchemaRequireParentEntityWithoutParentIdException`.  Default: `false`  Example: A "menu-item" schema that always belongs to a "menu" parent schema would set `require_parent_entity = true` and `parent_id` to the "menu" schema GUID. Every translation content item created for "menu-item" must then specify which menu it belongs to via `parent_entity_id`.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata for the next page of results.  
     - name: count | type: integer | description: Number of items returned in current page.  | validation: format int32
     - name: cursors | type: Cursors | description: Cursor strings that point to the next page, previous page, or both.  
        - name: next | type: string | description: Cursor string pointing to the next page in the list of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor pointing to the previous page in the list of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  + `true`: Another page of results can be retrieved. + `false`: This is the last page.  


```

### Examples

### querySchemas
```javascript
import { translationSchemas } from '@wix/multilingual';

async function querySchemas(query) {
  const response = await translationSchemas.querySchemas(query);
};
```

### querySchemas (with elevated permissions)
```javascript
import { translationSchemas } from '@wix/multilingual';
import { auth } from '@wix/essentials';

async function myQuerySchemasMethod(query) {
  const elevatedQuerySchemas = auth.elevate(translationSchemas.querySchemas);
  const response = await elevatedQuerySchemas(query);
}
```

### querySchemas (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 { translationSchemas } from '@wix/multilingual';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function querySchemas(query) {
  const response = await myWixClient.translationSchemas.querySchemas(query);
};
```

---