---
title: "Synchronize a schema."
method: PUT
path: "/api/apps/{app}/schemas/{schema}/sync"
tags: ["Schemas"]
---

# Synchronize a schema.

`PUT /api/apps/{app}/schemas/{schema}/sync`

## Path parameters

- `app` string, required
- `schema` string, required

## Request body

- SynchronizeSchemaDto
  - `properties` SchemaPropertiesDto
    - `label` string, nullable — Optional label for the editor.
    - `hints` string, nullable — Hints to describe the schema.
    - `contentsSidebarUrl` string, nullable — The url to a the sidebar plugin for content lists.
    - `contentSidebarUrl` string, nullable — The url to a the sidebar plugin for content items.
    - `contentEditorUrl` string, nullable — The url to the editor plugin.
    - `contentsEditorUrl` string, nullable — The url to the editor plugin.
    - `contentsListUrl` string, nullable — The url to the content list plugin.
    - `validateOnPublish` boolean, required — True to validate the content items on publish.
    - `tags` string[], nullable — Tags for automation processes.
  - `scripts` SchemaScriptsDto
    - `query` string, nullable — The script that is executed for each content when querying contents.
    - `queryPre` string, nullable — The script that is executed for all contents when querying contents.
    - `create` string, nullable — The script that is executed when creating a content.
    - `update` string, nullable — The script that is executed when updating a content.
    - `delete` string, nullable — The script that is executed when deleting a content.
    - `change` string, nullable — The script that is executed when change a content status.
  - `fieldsInReferences` string[], nullable — The names of the fields that should be used in references.
  - `fieldsInLists` string[], nullable — The names of the fields that should be shown in lists, including meta fields.
  - `fields` UpsertSchemaFieldDto[], nullable — Optional fields.
    - `name` string, required — The name of the field. Must be unique within the schema.
    - `isHidden` boolean — Defines if the field is hidden.
    - `isLocked` boolean — Defines if the field is locked.
    - `isDisabled` boolean — Defines if the field is disabled.
    - `partitioning` string, nullable — Determines the optional partitioning of the field.
    - `properties` FieldPropertiesDto, required
      - `label` string, nullable — Optional label for the editor.
      - `hints` string, nullable — Hints to describe the field.
      - `placeholder` string, nullable — Placeholder to show when no value has been entered.
      - `isRequired` boolean — Indicates if the field is required.
      - `isRequiredOnPublish` boolean — Indicates if the field is required when publishing.
      - `isHalfWidth` boolean — Indicates if the field should be rendered with half width only.
      - `editorUrl` string, nullable — Optional url to the editor.
      - `tags` string[], nullable — Tags for automation processes.
      - `fieldType` string, required
    - `nested` UpsertSchemaNestedFieldDto[], nullable — The nested fields.
      - `name` string, required — The name of the field. Must be unique within the schema.
      - `isHidden` boolean — Defines if the field is hidden.
      - `isLocked` boolean — Defines if the field is locked.
      - `isDisabled` boolean — Defines if the field is disabled.
      - `properties` FieldPropertiesDto, required
        - `label` string, nullable — Optional label for the editor.
        - `hints` string, nullable — Hints to describe the field.
        - `placeholder` string, nullable — Placeholder to show when no value has been entered.
        - `isRequired` boolean — Indicates if the field is required.
        - `isRequiredOnPublish` boolean — Indicates if the field is required when publishing.
        - `isHalfWidth` boolean — Indicates if the field should be rendered with half width only.
        - `editorUrl` string, nullable — Optional url to the editor.
        - `tags` string[], nullable — Tags for automation processes.
        - `fieldType` string, required
  - `previewUrls` object, nullable — The optional preview urls.
  - `fieldRules` FieldRuleDto[], nullable — The optional field Rules.
    - `action` 'Disable' | 'Hide' | 'Require', required
    - `field` string, required — The field to update.
    - `condition` string, nullable — The condition.
  - `category` string, nullable — The category.
  - `isPublished` boolean — Set it to true to autopublish the schema.
  - `noFieldDeletion` boolean — True, when fields should not be deleted.
  - `noFieldRecreation` boolean — True, when fields with different types should not be recreated.

## Response `200`

Schema updated.

- SchemaDto
  - `_links` object, required — The links.
  - `id` string, required — The ID of the schema.
  - `createdBy` string, required — The user that has created the schema.
  - `lastModifiedBy` string, required — The user that has updated the schema.
  - `name` string, required — The name of the schema. Unique within the app.
  - `type` 'Default' | 'Singleton' | 'Component', required
  - `category` string, nullable — The name of the category.
  - `properties` SchemaPropertiesDto, required
    - `label` string, nullable — Optional label for the editor.
    - `hints` string, nullable — Hints to describe the schema.
    - `contentsSidebarUrl` string, nullable — The url to a the sidebar plugin for content lists.
    - `contentSidebarUrl` string, nullable — The url to a the sidebar plugin for content items.
    - `contentEditorUrl` string, nullable — The url to the editor plugin.
    - `contentsEditorUrl` string, nullable — The url to the editor plugin.
    - `contentsListUrl` string, nullable — The url to the content list plugin.
    - `validateOnPublish` boolean, required — True to validate the content items on publish.
    - `tags` string[], nullable — Tags for automation processes.
  - `isSingleton` boolean, required — Indicates if the schema is a singleton.
  - `isPublished` boolean, required — Indicates if the schema is published.
  - `created` string, date-time, required — The date and time when the schema has been created.
  - `lastModified` string, date-time, required — The date and time when the schema has been modified last.
  - `version` integer, required — The version of the schema.
  - `scripts` SchemaScriptsDto, required
    - `query` string, nullable — The script that is executed for each content when querying contents.
    - `queryPre` string, nullable — The script that is executed for all contents when querying contents.
    - `create` string, nullable — The script that is executed when creating a content.
    - `update` string, nullable — The script that is executed when updating a content.
    - `delete` string, nullable — The script that is executed when deleting a content.
    - `change` string, nullable — The script that is executed when change a content status.
  - `previewUrls` object, required — The preview Urls.
  - `fieldsInLists` string[], required — The name of fields that are used in content lists.
  - `fieldsInReferences` string[], required — The name of fields that are used in content references.
  - `fieldRules` FieldRuleDto[], required — The field rules.
    - `action` 'Disable' | 'Hide' | 'Require', required
    - `field` string, required — The field to update.
    - `condition` string, nullable — The condition.
  - `fields` FieldDto[], required — The list of fields.
    - `_links` object, required — The links.
    - `fieldId` integer, required — The ID of the field.
    - `name` string, required — The name of the field. Must be unique within the schema.
    - `isHidden` boolean, required — Defines if the field is hidden.
    - `isLocked` boolean, required — Defines if the field is locked.
    - `isDisabled` boolean, required — Defines if the field is disabled.
    - `partitioning` string, required — Defines the partitioning of the field.
    - `properties` FieldPropertiesDto, required
      - `label` string, nullable — Optional label for the editor.
      - `hints` string, nullable — Hints to describe the field.
      - `placeholder` string, nullable — Placeholder to show when no value has been entered.
      - `isRequired` boolean — Indicates if the field is required.
      - `isRequiredOnPublish` boolean — Indicates if the field is required when publishing.
      - `isHalfWidth` boolean — Indicates if the field should be rendered with half width only.
      - `editorUrl` string, nullable — Optional url to the editor.
      - `tags` string[], nullable — Tags for automation processes.
      - `fieldType` string, required
    - `nested` NestedFieldDto[], nullable — The nested fields.
      - `_links` object, required — The links.
      - `fieldId` integer, required — The ID of the field.
      - `name` string, required — The name of the field. Must be unique within the schema.
      - `isHidden` boolean, required — Defines if the field is hidden.
      - `isLocked` boolean, required — Defines if the field is locked.
      - `isDisabled` boolean, required — Defines if the field is disabled.
      - `properties` FieldPropertiesDto, required
        - `label` string, nullable — Optional label for the editor.
        - `hints` string, nullable — Hints to describe the field.
        - `placeholder` string, nullable — Placeholder to show when no value has been entered.
        - `isRequired` boolean — Indicates if the field is required.
        - `isRequiredOnPublish` boolean — Indicates if the field is required when publishing.
        - `isHalfWidth` boolean — Indicates if the field should be rendered with half width only.
        - `editorUrl` string, nullable — Optional url to the editor.
        - `tags` string[], nullable — Tags for automation processes.
        - `fieldType` string, required

## Other responses

- `400` — Schema request not valid.
- `404` — Schema or app not found.
- `500` — Operation failed.

---

[API](https://skmtc.net/squidex/apis/squidex-api.md) · [All operations](https://skmtc.net/squidex/apis/squidex-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/squidex/squidex-api/versions/b4a9b62f113a/schema)
