# Update a content type

Update a content type.

Endpoint: PATCH /api/v1/content-types/{modelId}
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Path parameters:

  - `modelId` (string, required)
    The content type identifier.

## Query parameters:

  - `environmentId` (string)
    The environment identifier. Defaults to "main". Currently only "main" is supported.

## Request body:

  - `application/json, text/json, application/*+json` (unknown)
    Input data with details of the content type to be updated.

## Request fields (application/json):

  - `name` (string)
    Content type name.
Letters, numbers, spaces, underscores, and hyphens only.
    Example: Promo

  - `description` (string)
    Content type description.
    Example: Promo content type

  - `fieldGroups` (array)
    The list of field groups.

  - `fieldGroups.id` (string)
    Field group identifier. If present, the existing field group will be used. If not, a new field group will be created based on Name.
    Example: db765e2c-d745-462c-aa7b-e6cb11c5da8f

  - `fieldGroups.name` (string)
    The field group name. The name of new field group to create if Id is not provided.
Letters, numbers, spaces, underscores, and hyphens only.
    Example: Data

  - `fieldGroups.sortOrder` (integer)
    The numeric position of the field group within the content model.
    Example: 100

  - `fieldGroups.fields` (array)
    Fields in the group

  - `fieldGroups.fields.id` (string)
    The field identifier.
    Example: a1b2c3d4-e5f6-7890-abcd-ef1234567890

  - `fieldGroups.fields.name` (string)
    The field name.
Letters, numbers, spaces, underscores, and hyphens only.
    Example: PromoText

  - `fieldGroups.fields.shared` (boolean)
    Indicates whether the field is shared.

  - `fieldGroups.fields.type` (string, required)
    The field type.
    Example: Single-Line Text

  - `fieldGroups.fields.displayName` (string)
    The field display name.
    Example: Promo text

  - `fieldGroups.fields.helperText` (string)
    Help text for the field.
    Example: Enter helper text for display

  - `fieldGroups.fields.value` (object)
    Default value. Accepts object or string.
    Example: {"title":"sample title"}

  - `fieldGroups.fields.source` (string)
    The source of the field.
    Example: /sitecore/content/Tenant/Site/Home

  - `fieldGroups.fields.sortOrder` (integer)
    The sort order.
    Example: 100

  - `fieldGroups.fields.validationRules` (array)
    The validation rules assigned to the field as a list of validation rule IDs.
    Example: ["59D4EE10-627C-4FD3-A964-61A88B092CBC","A76C1092-EE2E-4021-B9EE-21E541CDA1D7"]

  - `baseContentTypes` (array)
    The base content types from which this content model inherits fields and properties.
    Example: ["497f6eca-6276-4993-bfeb-53cbbbba6f08"]

## Response 202:

  - `202` (unknown)
    Successful operation

## Response 202 fields (application/json):

  - `description` (string)
    The content type description.
    Example: Promo content type

  - `baseContentTypes` (array)
    The base content types this content type inherits from.

  - `baseContentTypes.id` (string)
    The content type identifier.
    Example: d4e5f6a7-b8c9-0123-4567-89abcdef0123

  - `baseContentTypes.name` (string)
    The content type name.
    Example: Promo

  - `baseContentTypes.system` (object)

  - `baseContentTypes.system.created` (string)
    The creation date.
    Example: 2024-01-01T12:00:00Z

  - `baseContentTypes.system.createdBy` (string)
    The user who created this resource.
    Example: sitecore\admin

  - `baseContentTypes.system.updated` (string)
    The last update date.
    Example: 2024-01-02T12:00:00Z

  - `baseContentTypes.system.updatedBy` (string)
    The author of the last update.
    Example: sitecore\admin

  - `fieldGroups` (array)
    The content type field groups.

  - `fieldGroups.id` (string)
    Field group identifier.
    Example: 223cba1d-4714-49b8-8d9a-b0dc1bed9cb3

  - `fieldGroups.name` (string)
    The field group name.
    Example: PromoText

  - `fieldGroups.sortOrder` (integer)
    The numeric position of the field group within the content model. Lower values appear first.
    Example: 1

  - `fieldGroups.fields` (array)
    The content type fields.

  - `fieldGroups.fields.id` (string)
    Field identifier.
    Example: 110D559F-DEA5-42EA-9C1C-8A5DF7E70EF

  - `fieldGroups.fields.name` (string)
    Field name.
    Example: Title

  - `fieldGroups.fields.type` (string)
    Field type.
    Example: Single-Line Text

  - `fieldGroups.fields.displayName` (string)
    Field display name.
    Example: Page Title

  - `fieldGroups.fields.value` (object)

  - `fieldGroups.fields.value.text` (string)
    The text value.
    Example: Sample content

  - `fieldGroups.fields.value.displayName` (string)
    The file display name.
    Example: Brochure

  - `fieldGroups.fields.value.name` (string)
    The file  name.
    Example: brochure.pdf

  - `fieldGroups.fields.value.extension` (string)
    The file  extension.
    Example: pdf

  - `fieldGroups.fields.value.size` (integer)
    The file size in bytes.
    Example: 120345

  - `fieldGroups.fields.value.id` (string)
    The file item identifier.
    Example: 4B9A6BAE-6B8D-4D72-BE0E-0BA769A8C24

  - `fieldGroups.fields.value.src` (string)
    The image source URL.
    Example: https://xmc.sitecore-staging.cloud/-/media/Project/sites/sample/image.jpeg

  - `fieldGroups.fields.value.alt` (string)
    The image alt text.
    Example: Sample image

  - `fieldGroups.fields.value.width` (string)
    The image width.
    Example: 800

  - `fieldGroups.fields.value.height` (string)
    The image height.
    Example: 600

  - `fieldGroups.fields.value.mediaId` (string)
    The media item identifier.
    Example: 8B53C9A7-2E80-4B35-B61D-33D7D8D4E24B

  - `fieldGroups.fields.value.href` (string)
    The link URL.
    Example: https://xmc.sitecore-staging.cloud/en/sitecore/shell/sites/sample/Home/About

  - `fieldGroups.fields.value.title` (string)
    The link title.
    Example: About

  - `fieldGroups.fields.value.type` (string)
    The link type.
    Example: internal

  - `fieldGroups.fields.value.attributes` (object)
    Additional link attributes.
    Example: {"target":"_blank","class":"my-css-class"}

  - `fieldGroups.fields.value.references` (array)

  - `fieldGroups.fields.value.references.id` (string)
    The referenced item id
    Example: {110D559A-CA9C-4B4C-8F31-DF8A0E6F447D}

  - `fieldGroups.fields.value.references.name` (string)
    The referenced item name
    Example: home

  - `fieldGroups.fields.value.references.displayName` (string)
    The referenced item display name
    Example: Home

  - `fieldGroups.fields.source` (string)
    Source of the field.
    Example: /sitecore/content/Home

  - `fieldGroups.fields.helperText` (string)
    Help text for the field.
    Example: Enter a concise title for the page

  - `fieldGroups.fields.versioning` (string)
    The versioning of the template field.
    Enum: "VERSIONED", "UNVERSIONED", "SHARED", "UNDEFINED"

  - `fieldGroups.fields.description` (string)
    The description of the template field. This value is language specific.
    Example: Main title shown in page header

  - `fieldGroups.fields.helpLink` (string)
    The help link of the template field.
    Example: https://doc.sitecore.com/field-guidance/title

  - `fieldGroups.fields.sortOrder` (integer)
    The sort order.
    Example: 100

  - `fieldGroups.fields.inherited` (boolean)
    Whether this field is inherited from a base template.
    Example: true

  - `fieldGroups.fields.baseContentModel` (string)
    The identifier of the base template this field is inherited from.
    Example: 76036f5e-cbce-46d1-af0a-4143f9b557aa

  - `fieldGroups.fields.settings` (object)
    The settings for the field.

  - `fieldGroups.fields.validationRules` (array)
    The validation rules assigned to the field as a list of validation rule item IDs
    Example: ["{11111111-1111-1111-1111-111111111111}","{22222222-2222-2222-2222-222222222222}"]

  - `id` (string)
    The content type identifier.
    Example: d4e5f6a7-b8c9-0123-4567-89abcdef0123

  - `name` (string)
    The content type name.
    Example: Promo

## Response 400:

  - `400` (unknown)
    One or more validation errors occurred

## Response 400 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `type` (string)
    The type of the error response entity.

  - `title` (string)
    The title of the error response entity.

  - `status` (integer)
    The response status code.

  - `detail` (string)
    A detailed explanation, specific to this occurrence of the problem.

  - `instance` (string)
    If available, a URI reference that identifies the specific occurrence of the problem.

