Skip to main content
PATCH
/
blueprints
/
{id}
/
projects
Add Template to Project
curl --request PATCH \
  --url https://api.env0.com/blueprints/{id}/projects \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "projectId": "<string>"
}'
{
  "name": "<string>",
  "description": "<string>",
  "retry": {
    "onDestroy": {
      "times": 123,
      "errorRegex": "<string>"
    },
    "onDeploy": {
      "times": 123,
      "errorRegex": "<string>"
    }
  },
  "runTestsOnPullRequest": true,
  "isTerragruntRunAll": true,
  "projectIds": [
    "<string>"
  ],
  "tagPrefix": "<string>",
  "repository": "<string>",
  "revision": "<string>",
  "path": "<string>",
  "fileName": "<string>",
  "helmChartName": "<string>",
  "terraformVersion": "<string>",
  "opentofuVersion": "<string>",
  "terragruntVersion": "<string>",
  "terragruntTfBinary": "terraform",
  "pulumiVersion": "<string>",
  "ansibleVersion": "<string>",
  "type": "opentofu",
  "tokenName": "<string>",
  "tokenId": "<string>",
  "sshKeys": [
    {
      "id": "<string>",
      "name": "<string>"
    }
  ],
  "githubInstallationId": 123,
  "bitbucketClientKey": "<string>",
  "isBitbucketServer": true,
  "isGitLabEnterprise": true,
  "isGitHubEnterprise": true,
  "isGitLab": true,
  "isAzureDevOps": true,
  "isHelmRepository": true,
  "vcsConnectionId": "<string>",
  "id": "<string>",
  "author": {
    "email": "<string>",
    "user_id": "<string>",
    "created_at": "<string>",
    "app_metadata": {},
    "picture": "<string>",
    "name": "<string>",
    "last_login": "<string>",
    "given_name": "<string>",
    "family_name": "<string>"
  },
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "isDeleted": true,
  "authorId": "<string>",
  "organizationId": "<string>",
  "projectId": "<string>",
  "isSingleUse": true
}

Authorizations

Authorization
string
header
required

env0 API authentication is done via API keys. An API Key can either be created by an organization administrator, in which case it will not be connected to any specific user, or via Personal API Keys to authenticate as a user.

Creating an API Key with a Specific Role

  • Once you've created your organization, you can set up and manage API Keys.

  • Navigate to the Organization Settings page and click the API Keys tab.

  • Click Add API Key and enter a name for your key in the Name field. This name is for reference purposes only and isn't used directly in authentication.

    โ—๏ธSave Your API Key ID and secret The secret will not be available after you close this window.

Creating a Personal API Key

  • Click on your avatar (located on the top right of the screen)

  • Click on Personal Settings

  • Select the API Keys tab

  • Click Add API Key, and enter a name for your key in the Name field. This name is for reference purposes and isn't used directly in authentication.

    โ—๏ธSave your API Key ID & secret The secret will not be available after you close this window.

Using an API Key to Authenticate

Authentication of the env0 API is done using the Basic Authentication method. Each request made should include the API Key ID as the username, and the API Key secret as the password. For example, when using curl, we can include these parameters via flag --user {API Key ID}:{API Key Secret}.

API Key Permissions

When creating an API key through the organization settings, you will need to choose if youโ€™d like to grant it Organization Admin or User permissions. In case of the latter, you can assign fine-grained permissions per project. Personal API Keys can be created through the userโ€™s profile page and will have the same permissions as the user has.

Rate Limits

env0 API allows up to 1K requests per 60 seconds, requests are aggregated by IP, HTTP Method and URI. If you exceed this limit, you will receive a 429 status code.

Path Parameters

id
string
required

Body

application/json
projectId
string
required

Response

200 - application/json
name
string
required
repository
string
required
type
enum<string>
required
Available options:
opentofu,
terraform,
terragrunt,
pulumi,
k8s,
cloudformation,
helm,
ansible,
workflow,
module,
approval-policy,
custom-flow,
environment-discovery,
discovery-config,
opentofu,
terraform,
terragrunt,
pulumi,
k8s,
cloudformation,
helm,
ansible,
workflow,
module,
approval-policy,
custom-flow,
environment-discovery,
discovery-config,
opentofu,
terraform,
terragrunt,
pulumi,
k8s,
cloudformation,
helm,
ansible,
workflow,
module,
approval-policy,
custom-flow,
environment-discovery,
discovery-config,
opentofu,
terraform,
terragrunt,
pulumi,
k8s,
cloudformation,
helm,
ansible,
workflow,
module,
approval-policy,
custom-flow,
environment-discovery,
discovery-config
organizationId
string
required
description
string
retry
object
runTestsOnPullRequest
boolean
isTerragruntRunAll
boolean
projectIds
string[]
tagPrefix
string
revision
string
path
string
fileName
string
helmChartName
string
terraformVersion

A string representing semantic version of Terraform. If set to "RESOLVE_FROM_TERRAFORM_CODE", the version will be determined by using tfenv's 'min-required'. When set to "latest", the version used will be the most recent one available for Terraform.

opentofuVersion
string
terragruntVersion
string
terragruntTfBinary
enum<string>
Available options:
terraform,
opentofu,
terraform,
opentofu,
terraform,
opentofu
pulumiVersion
string
ansibleVersion
string
tokenName
string
tokenId
string
sshKeys
object[]
githubInstallationId
number | null
bitbucketClientKey
string | null
isBitbucketServer
boolean
isGitLabEnterprise
boolean
isGitHubEnterprise
boolean
isGitLab
boolean
isAzureDevOps
boolean
isHelmRepository
boolean
vcsConnectionId
string | null
id
string
author
object
createdAt
string<date-time>
updatedAt
string<date-time>
isDeleted
boolean
authorId
string
projectId
string
isSingleUse
boolean
โŒ˜I