# Create a content item

Creates a new content item under the specified parent, which is also a content item. Content items are instances of a content type (specified in this call by templateId)

Endpoint: POST /api/v1/content-items
Version: v1
Security: Bearer

## Security:

  - `Bearer` (unknown)
    http Bearer

## Query parameters:

  - `environmentId` (string)
    The environment identifier.

## Request body:

  - `application/json, text/json, application/*+json` (unknown)
    The creation 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

  - `parentId` (string, required)
    The identifier of the content item that is the parent of the new content item.
    Example: {110D559F-DEA5-42EA-9C1C-8A5DF7E70EF9}

  - `templateId` (string, required)
    The content type identifier.
    Example: {76036F5E-CBCE-46D1-AF0A-4143F9B557AA}

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

  - `fields` (array)
    The content item field values. Each field's `Id` must match a field defined on the `TemplateId` and can be found by calling the Retrieve a Content Type endpoint in the Content Types API. When null or empty, the item is created with no field values.

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

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

## Response 201:

  - `201` (unknown)
    Successful operation

## Response 201 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

  - `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

  - `system` (object)

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

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

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

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

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

