---
updatedAt: 2025-05-30T03:39:54.000Z
agentTools:
  projectIndex: https://docs.testlify.com/llms.txt
---

# Create Assessment from Template

Creates a new assessment from an existing template. This endpoint allows resellers to create assessments based on predefined templates.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "Testlify API"
  },
  "servers": [
    {
      "url": "https://api.testlify.com"
    }
  ],
  "tags": [
    {
      "name": "Assessment",
      "description": "Operations related to assessments"
    }
  ],
  "paths": {
    "/v1/reseller/assessment": {
      "post": {
        "tags": [
          "Assessment"
        ],
        "summary": "Create Assessment from Template",
        "description": "Creates a new assessment from an existing template. This endpoint allows resellers to create assessments based on predefined templates.",
        "operationId": "create_assessment_from_template",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "description": "Assessment creation data",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "templateId"
                ],
                "properties": {
                  "templateId": {
                    "type": "string",
                    "description": "The unique identifier of the template to create assessment from",
                    "example": "64a1b2c3d4e5f6789012345a"
                  }
                }
              },
              "examples": {
                "basic_creation": {
                  "summary": "Basic assessment creation from template",
                  "value": {
                    "templateId": "64a1b2c3d4e5f6789012345a"
                  }
                },
                "with_settings": {
                  "summary": "Assessment creation with settings",
                  "value": {
                    "templateId": "64a1b2c3d4e5f6789012345a",
                    "settings": {}
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assessment created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Unique identifier of the created assessment"
                    },
                    "lastModifiedBy": {
                      "type": "string",
                      "description": "User ID who last modified the assessment"
                    },
                    "orgId": {
                      "type": "string",
                      "description": "Organization ID"
                    },
                    "userId": {
                      "type": "string",
                      "description": "User ID who created the assessment"
                    },
                    "title": {
                      "type": "string",
                      "description": "Assessment title"
                    },
                    "assessmentDescription": {
                      "type": "string",
                      "description": "Assessment description"
                    },
                    "libraries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "libraryId": {
                            "type": "string"
                          },
                          "questionLimit": {
                            "type": "integer"
                          },
                          "maximumScore": {
                            "type": "integer"
                          },
                          "codingLanguages": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "timeLimit": {
                            "type": "integer"
                          },
                          "sequence": {
                            "type": "integer"
                          },
                          "testLibraryTypeId": {
                            "type": "string"
                          },
                          "testLibraryTypeName": {
                            "type": "string"
                          },
                          "questionCountType": {
                            "type": "string"
                          },
                          "isCefr": {
                            "type": "boolean"
                          },
                          "industryType": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "customQuestions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "customQuestionId": {
                            "type": "string"
                          },
                          "timeLimit": {
                            "type": "integer"
                          },
                          "sequence": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "jobRoleId": {
                      "type": "string",
                      "description": "Job role identifier"
                    },
                    "assessmentStatus": {
                      "type": "string",
                      "enum": [
                        "DRAFT",
                        "PUBLISHED"
                      ],
                      "description": "Current status of the assessment"
                    },
                    "titleSlug": {
                      "type": "string",
                      "description": "URL-friendly version of the title"
                    },
                    "created": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Assessment creation timestamp"
                    },
                    "modified": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Assessment last modification timestamp"
                    },
                    "cloneTemplateId": {
                      "type": "string",
                      "description": "ID of the template this assessment was cloned from"
                    }
                  }
                },
                "examples": {
                  "successful_creation": {
                    "summary": "Successful assessment creation",
                    "value": {
                      "id": "64b2c3d4e5f67890123456ab",
                      "lastModifiedBy": "64c3d4e5f67890123456bcde",
                      "orgId": "64d4e5f67890123456cdefa1",
                      "userId": "64c3d4e5f67890123456bcde",
                      "title": "Administrative Assistant",
                      "assessmentDescription": "",
                      "libraries": [
                        {
                          "id": "64e5f67890123456def01abc",
                          "libraryId": "64f6789012345678901abcde",
                          "questionLimit": 5,
                          "maximumScore": 0,
                          "codingLanguages": [],
                          "timeLimit": 300,
                          "sequence": 0,
                          "testLibraryTypeId": "650789012345679012bcdef1",
                          "testLibraryTypeName": "Situational Judgement",
                          "questionCountType": "ALL",
                          "isCefr": false,
                          "industryType": null
                        },
                        {
                          "id": "651890123456789023cdef12",
                          "libraryId": "652901234567890134def123",
                          "questionLimit": 5,
                          "maximumScore": 0,
                          "codingLanguages": [],
                          "timeLimit": 300,
                          "sequence": 1,
                          "testLibraryTypeId": "653012345678901245ef1234",
                          "testLibraryTypeName": "Cognitive ability",
                          "questionCountType": "ALL",
                          "isCefr": false,
                          "industryType": null
                        }
                      ],
                      "customQuestions": [
                        {
                          "id": "654123456789012356f12345",
                          "customQuestionId": "655234567890123467012345",
                          "timeLimit": 120,
                          "sequence": 0,
                          "title": ""
                        },
                        {
                          "id": "656345678901234578123456",
                          "customQuestionId": "657456789012345689234567",
                          "timeLimit": 120,
                          "sequence": 1,
                          "title": ""
                        }
                      ],
                      "jobRoleId": "658567890123456790345678",
                      "assessmentStatus": "DRAFT",
                      "titleSlug": "administrative-assistant",
                      "created": "2025-05-30T10:15:22.831Z",
                      "modified": "2025-05-30T10:15:22.831Z",
                      "cloneTemplateId": "64a1b2c3d4e5f6789012345a"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request - Various validation and business logic errors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "statusCode": {
                          "type": "integer",
                          "example": 400
                        },
                        "name": {
                          "type": "string",
                          "example": "BadRequestError"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "assessment_not_found": {
                    "summary": "Assessment Not Found",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Assessment Not Found"
                      }
                    }
                  },
                  "daily_limit_exceeded": {
                    "summary": "Daily Assessment Creation Limit Exceeded",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Your Daily Limit to Create Assessment is Over"
                      }
                    }
                  },
                  "monthly_limit_exceeded": {
                    "summary": "Monthly Assessment Creation Limit Exceeded",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Your Monthly Limit to Create Assessment is Over"
                      }
                    }
                  },
                  "user_workspace_profile_not_found": {
                    "summary": "User Workspace Profile Not Found",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "User Workspace Profile Not Found"
                      }
                    }
                  },
                  "assessment_archived": {
                    "summary": "Assessment is Archived",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Assessment is archived"
                      }
                    }
                  },
                  "assessment_draft_status": {
                    "summary": "Assessment is in Draft Status",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Assessment is in Draft status"
                      }
                    }
                  },
                  "time_object_null_required": {
                    "summary": "Time Object Should Be Null",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Time Object should be null for NEVER_EXPIRE type"
                      }
                    }
                  },
                  "time_object_required": {
                    "summary": "Time Object Required",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Time Object should not be null for CUSTOM_EXPIRE type"
                      }
                    }
                  },
                  "tz_validtilltime_required": {
                    "summary": "TZ and ValidTillTime Required",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "TZ and validTillTime is required field"
                      }
                    }
                  },
                  "invalid_timezone": {
                    "summary": "Invalid Timezone",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Invalid timezone"
                      }
                    }
                  },
                  "invalid_type": {
                    "summary": "Invalid Type",
                    "value": {
                      "error": {
                        "statusCode": 400,
                        "name": "BadRequestError",
                        "message": "Invalid type"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "statusCode": {
                          "type": "number"
                        },
                        "name": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "invalid_token": {
                    "summary": "Invalid token",
                    "value": {
                      "error": {
                        "statusCode": 401,
                        "name": "UnauthorizedError",
                        "message": "Error verifying token : invalid signature"
                      }
                    }
                  },
                  "token_expired": {
                    "summary": "Access token expired",
                    "value": {
                      "error": {
                        "statusCode": 401,
                        "name": "UnauthorizedError",
                        "message": "Access token expired"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden - Access denied or restricted operations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "statusCode": {
                          "type": "integer",
                          "example": 403
                        },
                        "name": {
                          "type": "string",
                          "example": "ForbiddenError"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "unverified_user": {
                    "summary": "Unverified User",
                    "value": {
                      "error": {
                        "statusCode": 403,
                        "name": "ForbiddenError",
                        "message": "Unverified user"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found - Resource not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "statusCode": {
                          "type": "integer",
                          "example": 404
                        },
                        "name": {
                          "type": "string",
                          "example": "NotFoundError"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "template_not_found": {
                    "summary": "Template Not Found",
                    "value": {
                      "error": {
                        "statusCode": 404,
                        "name": "NotFoundError",
                        "message": "Template not found"
                      }
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Conflict - Resource conflicts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "statusCode": {
                          "type": "integer",
                          "example": 409
                        },
                        "name": {
                          "type": "string",
                          "example": "ConflictError"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "source_name_taken": {
                    "summary": "Source Name Already Taken",
                    "value": {
                      "error": {
                        "statusCode": 409,
                        "name": "ConflictError",
                        "message": "Source name is already taken"
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity - Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "statusCode": {
                          "type": "integer",
                          "example": 422
                        },
                        "name": {
                          "type": "string",
                          "example": "UnprocessableEntityError"
                        },
                        "message": {
                          "type": "string"
                        },
                        "code": {
                          "type": "string"
                        },
                        "details": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "path": {
                                "type": "string"
                              },
                              "code": {
                                "type": "string"
                              },
                              "message": {
                                "type": "string"
                              },
                              "info": {
                                "type": "object"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "missing_template_id": {
                    "summary": "Missing required templateId",
                    "value": {
                      "error": {
                        "statusCode": 422,
                        "name": "UnprocessableEntityError",
                        "message": "The request body is invalid. See error object `details` property for more info.",
                        "code": "VALIDATION_FAILED",
                        "details": [
                          {
                            "path": "",
                            "code": "required",
                            "message": "must have required property 'templateId'",
                            "info": {
                              "missingProperty": "templateId"
                            }
                          }
                        ]
                      }
                    }
                  },
                  "invalid_template_id_format": {
                    "summary": "Invalid templateId format",
                    "value": {
                      "error": {
                        "statusCode": 422,
                        "name": "UnprocessableEntityError",
                        "message": "The request body is invalid. See error object `details` property for more info.",
                        "code": "VALIDATION_FAILED",
                        "details": [
                          {
                            "path": "templateId",
                            "code": "type",
                            "message": "must be string",
                            "info": {
                              "type": "string"
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "object",
                      "properties": {
                        "statusCode": {
                          "type": "number"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "error": {
                    "statusCode": 500,
                    "message": "Internal Server Error"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}
```