# Create an entity

Creates an entity with the specified details, including associated members and groups. The link to the associated `Entity Definition Resource` is required. The `self` property is ignored and can be omitted.   If the request body contains an `id`, the request is treated as a possible `UPSERT`. If the `id` is omitted and only an `identifier` is provided, the request returns a conflict instead of updating the existing entity. The request then checks for the existence of the entity and if the response is positive, it updates the entity based on the provided body elements. When an `id` is present, the header contains the same `Location` property as with a normal `POST` response. When an `identifier` is used, the header contains an `X-Global-Identifier` property with the updated identifier as its value.   Use the [Upload API](https://doc.sitecore.com/ch/en/developers/cloud-dev/upload.html) to upload assets to Content Hub. It is not possible to set relations while creating an entity unless the relations are nested. Additionally, this functionality is available only through the REST API and not through the Web Client SDK. For non-nested relations one call is made for each relation that is updated.

Endpoint: POST /api/entities
Version: v2.0
Security: OAuth2

## Security:

  - `OAuth2` (unknown)
    oauth2

## Query parameters:

  - `culture` (string)
    Culture for the entity, for example `en-US`.

  - `groups` (string)
    Member groups to associate with the entity, for example `PreambleGroup,ChoiceGroup`.

  - `members` (string)
    Members to associate with the entity, for example `PreambleThemeProperty,ChoiceThemeProperty`.

## Request body:

  - `application/json` (unknown)
    Details of the entity to be added.

## Request fields (application/json):

  - `id` (integer)
    Gets or sets the entity ID.

  - `identifier` (string)
    Gets or sets the entity identifier.

  - `properties` (object)
    Gets or sets the properties of the entity.

  - `relations` (object)
    Gets or sets the relations of the entity.

  - `is_root_taxonomy_item` (boolean)
    Gets or sets a value indicating whether the entity is a root taxonomy item.

  - `is_path_root` (boolean)
    Gets or sets a value indicating whether the entity is a path root.

  - `entitydefinition` (object)
    Represents a link to a resource.

  - `entitydefinition.href` (string)
    Gets or sets the URI that points to the resource this link refers to.

  - `entitydefinition.filename_properties` (array)
    Gets or sets the URI that points to the resource this link refers to.

  - `entitydefinition.title` (string)
    Gets or sets the title that describes this link.

  - `entitydefinition.templated` (boolean)
    Gets or sets a value indicating whether the contained URI is a template.

  - `is_system_owned` (boolean)
    Gets or sets a value indicating whether the entity is system owned.

  - `inherits_security` (boolean)
    Gets or sets a value indicating whether the entity inherits security.

## Response 200:

  - `200` (unknown)
    Successful operation

## Response 400:

  - `400` (unknown)
    Request not valid(for example, less than or equal to zero), or target resource is null.

## Response 401:

  - `401` (unknown)
    Unauthorized request

## Response 404:

  - `404` (unknown)
    Entity not found or user not authorized

