# Replace a content item

Fully replaces a content item. Fields omitted from the request are cleared. 

 Note: the 'language' property is now a query parameter, and not to be used in the request body. Use 'language' to replace the specific language version of the content item. The property will still be accepted in the request body, but is now ignored unless sent as a query parameter.

Endpoint: PUT /api/v1/content-items/{id}
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Path parameters:

  - `id` (string, required)
    The content item identifier.

## Query parameters:

  - `environmentId` (string)
    The environment identifier.

  - `language` (string)
    The optional language selector. Defaults to "en" when omitted.

  - `version` (integer)
    The optional version selector. When omitted, the latest version in the selected language is updated.

## Request body:

  - `application/json, text/json, application/*+json` (unknown)
    The replacement input.

## Request fields (application/json):

  - `name` (string, required)
    The content item name.
    Example: MyContentItem

  - `displayName` (string)
    The content item display name.
    Example: My Content Item

  - `fields` (array, required)
    The complete set of field values for the content item.
Fields present in the current item but omitted here are cleared (set to empty value).
The service resolves each field's type from the content type before serialization.

  - `fields.id` (string)
    The field identifier
    Example: 75577384-3C97-45DA-A847-81B00500E25

  - `fields.value` (object)
    The field value
    Example: {"title":"sample title"}

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 200 fields (application/json):

  - `isFallback` (boolean)
    Indicates whether any item-level fallback was used for the response.
    Example: true

  - `revision` (string)
    Unique revision identifier for the content item. Used as an optimistic concurrency guard during save or update operations. 
The value is updated whenever the item changes, allowing clients to verify that they are updating the latest revision.
    Example: 37265ed7-85cf-4876-9c09-b6590fc6cf3a

  - `fields` (array)
    The content item fields.

  - `fields.id` (string)
    The field identifier.
    Example: 37265ed7-85cf-4876-9c09-b6590fc6cf3a

  - `fields.name` (string)
    The field name.
    Example: Title

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

  - `fields.displayName` (string)
    The field display name.
    Example: Display Name

  - `fields.value` (object)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  - `fields.value.references` (array)

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

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

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

  - `fields.access` (object)
    The item field access permissions model.

  - `fields.access.canRead` (boolean)
    Can Read.

  - `fields.access.canWrite` (boolean)
    Can Write.

  - `fields.label` (string)
    The field label.
    Example: Page Title

  - `fields.containsStandardValue` (boolean)
    Whether field contains standard value.
    Example: false

  - `fields.containsFallbackValue` (boolean)
    Whether field contains fallback value.
    Example: false

  - `allowedContentTypes` (array)
    The allowed content types for the content item.

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

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

  - `allowedContentTypes.path` (string)
    The content type path in the content hierarchy.
    Example: /Content Types/Marketing/Promo

  - `allowedContentTypes.system` (object)

  - `allowedContentTypes.system.created` (string)
    The creation time.
    Example: 2024-01-15T10:30:00Z

  - `allowedContentTypes.system.createdBy` (string)
    The creator.
    Example: sitecore admin

  - `allowedContentTypes.system.updated` (string)
    The last updating time.
    Example: 2024-01-15T10:30:00Z

  - `allowedContentTypes.system.updatedBy` (string)
    The last updater.
    Example: sitecore admin

  - `id` (string)
    The content item identifier.
    Example: 37265ed7-85cf-4876-9c09-b6590fc6cf3a

  - `name` (string)
    The content item name.
    Example: My content item

  - `displayName` (string)
    The content item display name.
    Example: My content item

  - `language` (string)
    The content item language.
    Example: en

  - `version` (integer)
    The content item version.
    Example: 1

  - `templateId` (string)
    The  template identifier.
    Example: 97265ed7-85cf-4876-9c09-b6590fc6cf3a

  - `path` (string)
    The content item path.
    Example: /sitecore/content/Home

  - `permissions` (object)
    The access rights of the current user to the site.

  - `permissions.canAdmin` (boolean)
    Whether the current user has admin rights
    Example: true

  - `permissions.canWrite` (boolean)
    Whether the current user has permissions to edit values
    Example: true

  - `permissions.canCreate` (boolean)
    Whether the current user has permissions to create entities
    Example: true

  - `permissions.canDelete` (boolean)
    Whether the current user has permissions to delete entities
    Example: true

  - `permissions.canRename` (boolean)
    Whether the current user has permissions to rename  entities
    Example: true

  - `permissions.canRead` (boolean)
    Whether the current user has permissions to see  entities
    Example: true

  - `permissions.canPublish` (boolean)
    Whether the current user has permissions to publish sites in this environment
    Example: true

  - `permissions.canDuplicate` (boolean)
    Whether the current user has permissions to duplicate entities
    Example: true

  - `permissions.canWriteLanguage` (boolean)
    Whether the current user has permissions to write item language entities
    Example: true

## Response 400:

  - `400` (unknown)
    Invalid input format

## 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.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 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 404:

  - `404` (unknown)
    Content item not found

## Response 404 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.

