---
agentTools:
  projectIndex: https://clientsuccess.readme.io/llms.txt
---

# Create milestone from template

Creates and saves a milestone in database from template

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "description": "Open Backend API of Task Service",
    "version": "V2.0",
    "title": "Task Service API",
    "license": {
      "name": "Public of ClientSuccess.com",
      "url": "javascript://void"
    },
    "x-logo": {
      "url": "logo.svg"
    }
  },
  "tags": [
    {
      "name": "Milestone API",
      "description": "Milestone Controller"
    }
  ],
  "paths": {
    "/milestone/template/{milestoneTemplateId}/{projectUuid}/{clientId}": {
      "post": {
        "tags": [
          "Milestone API"
        ],
        "summary": "Create milestone from template",
        "description": "Creates and saves a milestone in database from template",
        "operationId": "createFromTemplateUsingPOST_3",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "description": "clientId",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "milestoneTemplateId",
            "in": "path",
            "description": "milestoneTemplateId",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "projectUuid",
            "in": "path",
            "description": "projectUuid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MilestoneDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDto"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "object.validation.failed",
                      "cause": "Bad Request",
                      "code": 400
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDto"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "user.authentication.failed",
                      "cause": "Forbidden",
                      "code": 403
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDto"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "requested.object.not.found",
                      "cause": "Not Found",
                      "code": 404
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorDto"
                },
                "examples": {
                  "response": {
                    "value": {
                      "message": "internal.server.error",
                      "cause": "Internal Server Error",
                      "code": 500
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "gen-auth": []
          }
        ]
      }
    }
  },
  "servers": [
    {
      "url": "//api.clientsuccess.com/v2"
    }
  ],
  "components": {
    "securitySchemes": {
      "gen-auth": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    },
    "schemas": {
      "EmployeeDto": {
        "type": "object",
        "properties": {
          "avatar": {
            "type": "string",
            "description": "The avatar of employee"
          },
          "companyName": {
            "type": "string",
            "description": "The companyName of employee"
          },
          "companyUrl": {
            "type": "string",
            "description": "The companyUrl of employee"
          },
          "external": {
            "type": "boolean",
            "description": "The external flag"
          },
          "firstName": {
            "type": "string",
            "description": "The firstName of employee"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "description": "The id of employee"
          },
          "lastName": {
            "type": "string",
            "description": "The lastName of employee"
          },
          "tenantId": {
            "type": "integer",
            "format": "int32",
            "description": "The tenant id of employee"
          },
          "user": {
            "$ref": "#/components/schemas/UserDto"
          },
          "uuid": {
            "type": "string",
            "description": "The uuid of employee"
          }
        },
        "title": "EmployeeDto",
        "description": "The DTO of employee entity"
      },
      "ErrorDto": {
        "type": "object",
        "properties": {
          "cause": {
            "type": "string",
            "description": "The original exception cause"
          },
          "code": {
            "type": "integer",
            "format": "int32",
            "description": "The internal system code of exception"
          },
          "details": {
            "$ref": "#/components/schemas/JsonNode"
          },
          "message": {
            "type": "string",
            "description": "The original exception message"
          }
        },
        "title": "ErrorDto",
        "description": "The error object that represents any unhandled exceptions raised in service"
      },
      "JsonNode": {
        "type": "object",
        "title": "JsonNode"
      },
      "MilestoneDto": {
        "type": "object",
        "properties": {
          "completedDate": {
            "type": "string",
            "format": "date",
            "example": "2021-12-21",
            "description": "Completed date of milestone"
          },
          "createdBy": {
            "$ref": "#/components/schemas/EmployeeDto"
          },
          "createdDateTime": {
            "type": "string",
            "format": "date-time",
            "description": "Created date time of milestone"
          },
          "dueDate": {
            "type": "string",
            "format": "date",
            "example": "2021-12-21",
            "description": "Due date of milestone"
          },
          "milestoneTemplateId": {
            "type": "integer",
            "format": "int32",
            "description": "The milestone template id"
          },
          "modifiedBy": {
            "$ref": "#/components/schemas/EmployeeDto"
          },
          "modifiedDateTime": {
            "type": "string",
            "format": "date-time",
            "description": "Created date time of milestone"
          },
          "name": {
            "type": "string",
            "description": "The milestone name"
          },
          "projectUuid": {
            "type": "string",
            "description": "The project uuid"
          },
          "startDate": {
            "type": "string",
            "format": "date",
            "example": "2021-12-21",
            "description": "Start date of milestone"
          },
          "status": {
            "type": "string",
            "description": "The milestone status used for project dashboard",
            "enum": [
              "COMPLETED",
              "MILESTONE_BEHIND",
              "ON_TRACK",
              "TASK_BEHIND"
            ]
          },
          "tenantId": {
            "type": "integer",
            "format": "int32",
            "description": "The tenant id"
          },
          "uuid": {
            "type": "string",
            "description": "The milestone uuid"
          }
        },
        "title": "MilestoneDto",
        "description": "The DTO of milestone entity"
      },
      "UserDto": {
        "type": "object",
        "properties": {
          "avatar": {
            "type": "string",
            "description": "The avatar of user"
          },
          "email": {
            "type": "string",
            "description": "The email of user"
          },
          "firstName": {
            "type": "string",
            "description": "The firstName of user"
          },
          "id": {
            "type": "integer",
            "format": "int32",
            "description": "The id of user"
          },
          "lastName": {
            "type": "string",
            "description": "The lastName of user"
          },
          "uuid": {
            "type": "string",
            "description": "The uuid of user"
          }
        },
        "title": "UserDto",
        "description": "The DTO of user entity"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 100,
      "1": 98,
      "2": 5,
      "3": 59,
      "4": 85,
      "5": 225,
      "6": 145,
      "7": 0,
      "8": 37,
      "9": 216,
      "10": 245,
      "11": 231
    }
  }
}
```