> ## Documentation Index
> Fetch the complete documentation index at: https://infisical.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Project templates

> Learn how to manage and apply project templates

## Concept

Project Templates streamline your ability to set up projects by providing customizable templates to configure projects quickly with a predefined set of environments and roles.

> [!NOTE]
>
> Project Templates is a paid feature.
> If you're using Infisical Cloud, then it's available under the **Enterprise Tier**. If you're self-hosting Infisical,
> then you should contact [sales@infisical.com](mailto:sales@infisical.com) to purchase an enterprise license to use it.

## Workflow

The typical workflow for using Project Templates consists of the following steps:

1. **Creating a project template:** As part of this step, you'll configure a set of environments and roles to be created when applying this template to a project.
2. **Using a project template:** When creating new projects, optionally specify a project template to provision the project with the configured roles and environments.

> [!NOTE]
>
> Note that this workflow can be executed via the Infisical UI or through the API.

## Guide to creating a project template

In the following steps, we'll explore how to set up a project template.

> [tab] Infisical UI
>
> **1. Creating a Project Template**
>
> Open the product you want to create a template for, go to **Product Settings**, and select **Add Template** in the **Project Templates** section.
>
> ![project template add button](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/platform/project-templates/project-template-add-button.png)
>
> Specify your template details. Here's some guidance on each field:
>
> * **Name:** A slug-friendly name for the template.
> * **Description:** An optional description of the intended usage of this template.
>
>   ![project template create modal](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/platform/project-templates/project-template-create.png)
>
> **2. Configuring a Project Template**
>
> Once your template is created, you'll be directed to the configuration section.
>
> ![project template edit form](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/platform/project-templates/project-template-edit-form.png)
>
> Customize the environments and roles to your needs.
>
> ![project template customized](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/platform/project-templates/project-template-customized.png)
>
> > [!NOTE]
> >
> > Be sure to save your environment and role changes.

> [tab] API
>
> To create a project template, make an API request to the [Create Project Template](https://infisical.com/docs/api-reference/endpoints/project-templates/create.md) API endpoint.
>
> ### Sample request
>
> ```bash Request theme={"dark"}
> curl --request POST \
> --url https://app.infisical.com/api/v1/project-templates \
> --header 'Content-Type: application/json' \
> --data '{
>     "name": "my-project-template",
>     "type": "secret-manager",
>     "description": "...",
>     "environments": "[...]",
>     "roles": "[...]",
> }'
> ```
>
> ### Sample response
>
> ```bash Response theme={"dark"}
> {
>     "projectTemplate": {
>         "id": "<template-id>",
>         "name": "my-project-template",
>         "description": "...",
>         "environments": "[...]",
>         "roles": "[...]",
>         "orgId": "<org-id>",
>         "createdAt": "2023-11-07T05:31:56Z",
>         "updatedAt": "2023-11-07T05:31:56Z",
>     }
> }
> ```

## Guide to using a project template

In the following steps, we'll explore how to use a project template when creating a project.

> [tab] Infisical UI
>
> When creating a new project, expand **Advanced Settings** and pick the template from the **Project Template** dropdown.
>
> ![project template apply](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/platform/project-templates/project-template-apply.png)
>
> Your project will be provisioned with the configured template roles and environments.

> [tab] API
>
> To use a project template, make an API request to the [Create Project](https://infisical.com/docs/api-reference/endpoints/projects/create-project.md) API endpoint with the specified template name included.
>
> ### Sample request
>
> ```bash Request theme={"dark"}
> curl --request POST \
> --url https://app.infisical.com/api/v1/projects \
> --header 'Authorization: Bearer <token>' \
> --header 'Content-Type: application/json' \
> --data '{
>     "projectName": "My Project",
>     "template": "<template-name>", // defaults to "default"
> }'
> ```
>
> ### Sample response
>
> ```bash Response theme={"dark"}
> {
>     "project": {
>         "id": "<project-id>",
>         "environments": "[...]", // configured environments
>         ...
>     }
> }
> ```
>
> > [!NOTE]
> >
> > Note that configured roles aren't included in the project response.

## FAQ

> [accordion] Do changes to templates propagate to existing projects?
>
> No. Project templates only apply at the time of project creation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.