---
title: "Create a new template"
method: POST
path: "/api/v1/entity-templates"
tags: ["Entities Templates Management"]
---

# Create a new template

`POST /api/v1/entity-templates`

Create a new template in the system with the provided information

## Request body

- EntityTemplateCreateDtoIn — Input DTO for creating an entity template
  - `identifier` string, required — Unique Entity Template identifier
  - `name` string, required — Unique Entity Template name
  - `description` string — Entity Template description
  - `properties_definitions` PropertyDefinitionDtoIn[] — List of property definitions for this template
    - `name` string, required — Property name
    - `description` string, required — Property description
    - `type` 'STRING' | 'NUMBER' | 'BOOLEAN', required — Property data type
    - `required` boolean — Whether this property is required
    - `rules` PropertyRulesDtoIn — Input DTO for creating or updating a property definition
      - `format` 'URL' | 'EMAIL' — Property format validation
      - `enum_values` string[] — Enumeration values for enum properties
      - `regex` string — Regular expression pattern for validation
      - `max_length` integer — Maximum length for string properties
      - `min_length` integer — Minimum length for string properties
      - `max_value` integer — Maximum value for numeric properties
      - `min_value` integer — Minimum value for numeric properties
  - `relations_definitions` RelationDefinitionDtoIn[] — List of relation definitions for this template
    - `name` string, required — Name of the relation
    - `target_template_identifier` string, required — Identifier of the target template
    - `required` boolean — Whether this relation is required
    - `to_many` boolean — Whether this relation can have multiple targets

## Response `201`

Template created successfully

## Other responses

- `400` — Invalid template data provided

---

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