---
updatedAt: 2026-06-12T20:00:32.000Z
agentTools:
  projectIndex: https://layer-api.readme.io/llms.txt
---

# Apply Template to Project

Applies a template to an existing project, copying its categories and fields. If this template has already been applied to the project, set confirm to true to re-apply.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "termsOfService": "https://layer.team/terms-of-service",
    "title": "Layer API",
    "version": "0.3.0",
    "x-logo": {
      "altText": "Layer logo",
      "url": "https://layer.team/wp-content/themes/lessis/images/assets/layer-logo-footer.png"
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "bearerFormat": "JWT",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "paths": {
    "/projects/{projectId}/apply-template": {
      "post": {
        "operationId": "applyTemplateToProject",
        "summary": "Apply Template to Project",
        "tags": [
          "Templates"
        ],
        "description": "Applies a template to an existing project, copying its categories and fields. If this template has already been applied to the project, set confirm to true to re-apply.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "templateId"
                ],
                "properties": {
                  "confirm": {
                    "description": "Set to true to confirm re-applying a template that has already been applied to this project",
                    "type": "boolean"
                  },
                  "templateId": {
                    "description": "ID of the template to apply",
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "in": "path",
            "name": "projectId",
            "required": true,
            "description": "Project ID"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Template successfully applied",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Template successfully applied",
                  "type": "object",
                  "required": [
                    "counts",
                    "project"
                  ],
                  "properties": {
                    "counts": {
                      "type": "object",
                      "required": [
                        "categories",
                        "elements",
                        "fields"
                      ],
                      "properties": {
                        "categories": {
                          "description": "Number of categories created",
                          "type": "number"
                        },
                        "elements": {
                          "description": "Number of elements created",
                          "type": "number"
                        },
                        "fields": {
                          "description": "Number of fields created",
                          "type": "number"
                        }
                      }
                    },
                    "project": {
                      "type": "object",
                      "required": [
                        "company",
                        "createdAt",
                        "createdBy",
                        "id",
                        "location",
                        "name",
                        "status",
                        "type"
                      ],
                      "properties": {
                        "company": {
                          "description": "Name of the company that owns the project",
                          "type": "string"
                        },
                        "createdAt": {
                          "description": "Date & time the project was created",
                          "format": "date-time",
                          "type": "string"
                        },
                        "createdBy": {
                          "description": "Name of the user who created the project",
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "location": {
                          "description": "Project location",
                          "type": "string"
                        },
                        "name": {
                          "description": "Name of the project",
                          "type": "string"
                        },
                        "status": {
                          "description": "Project status",
                          "enum": [
                            "active",
                            "archived"
                          ],
                          "type": "string"
                        },
                        "type": {
                          "description": "Project type",
                          "enum": [
                            "TEMPLATE",
                            "PROJECT"
                          ],
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Default error response.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Default error response.",
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "description": "Human-readable error message.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Default error response.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Default error response.",
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "description": "Human-readable error message.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Default error response.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Default error response.",
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "description": "Human-readable error message.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Default error response.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Default error response.",
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "description": "Human-readable error message.",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Response payload exceeded the configured size limit for this API.",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Response payload exceeded the configured size limit for this API.",
                  "properties": {
                    "code": {
                      "description": "Stable machine-readable error code.",
                      "type": "string"
                    },
                    "error": {
                      "description": "Human-readable error message.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "error"
                  ],
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://api.layer.team"
    }
  ],
  "x-readme": {
    "samples-languages": [
      "curl"
    ]
  }
}
```