curl --request POST \
--url https://api.env0.com/environments/without-template \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"projectId": "<string>",
"organizationId": "<string>",
"repository": "<string>",
"deployRequest": {
"comment": "<string>",
"subEnvironments": {},
"targets": [
"<string>"
],
"gitUserData": {
"gitUser": "<string>",
"gitAvatarUrl": "<string>",
"prNumber": "<string>"
}
},
"workspaceName": "<string>",
"requiresApproval": true,
"configurationChanges": {
"name": "<string>",
"value": "<string>",
"id": "<string>",
"isSensitive": true,
"isReadonly": true,
"isRequired": true,
"regex": "<string>",
"toDelete": true,
"projectId": "<string>",
"schema": {
"enum": [
"<string>"
]
},
"description": "<string>",
"isOutput": true
},
"configurationSetChanges": {
"assign": [
"<string>"
],
"unassign": [
"<string>"
]
},
"continuousDeployment": true,
"pullRequestPlanDeployments": true,
"vcsPrCommentsEnabled": true,
"vcsCommandsAlias": "<string>",
"driftDetectionRequest": {
"enabled": true,
"cron": "<string>"
},
"autoDeployOnPathChangesOnly": true,
"autoDeployByCustomGlob": "<string>",
"terragruntWorkingDirectory": "<string>",
"isRemoteBackend": true,
"k8sNamespace": "<string>",
"preventAutoDeploy": true,
"isRemoteApplyEnabled": true,
"description": "<string>",
"retry": {
"onDestroy": {
"times": 123,
"errorRegex": "<string>"
},
"onDeploy": {
"times": 123,
"errorRegex": "<string>"
}
},
"runTestsOnPullRequest": true,
"isTerragruntRunAll": true,
"projectIds": [
"<string>"
],
"tagPrefix": "<string>",
"creationScopeId": "<string>",
"revision": "<string>",
"path": "<string>",
"fileName": "<string>",
"helmChartName": "<string>",
"terraformVersion": "<string>",
"opentofuVersion": "<string>",
"terragruntVersion": "<string>",
"pulumiVersion": "<string>",
"ansibleVersion": "<string>",
"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>"
}
'import requests
url = "https://api.env0.com/environments/without-template"
payload = {
"name": "<string>",
"projectId": "<string>",
"organizationId": "<string>",
"repository": "<string>",
"deployRequest": {
"comment": "<string>",
"subEnvironments": {},
"targets": ["<string>"],
"gitUserData": {
"gitUser": "<string>",
"gitAvatarUrl": "<string>",
"prNumber": "<string>"
}
},
"workspaceName": "<string>",
"requiresApproval": True,
"configurationChanges": {
"name": "<string>",
"value": "<string>",
"id": "<string>",
"isSensitive": True,
"isReadonly": True,
"isRequired": True,
"regex": "<string>",
"toDelete": True,
"projectId": "<string>",
"schema": { "enum": ["<string>"] },
"description": "<string>",
"isOutput": True
},
"configurationSetChanges": {
"assign": ["<string>"],
"unassign": ["<string>"]
},
"continuousDeployment": True,
"pullRequestPlanDeployments": True,
"vcsPrCommentsEnabled": True,
"vcsCommandsAlias": "<string>",
"driftDetectionRequest": {
"enabled": True,
"cron": "<string>"
},
"autoDeployOnPathChangesOnly": True,
"autoDeployByCustomGlob": "<string>",
"terragruntWorkingDirectory": "<string>",
"isRemoteBackend": True,
"k8sNamespace": "<string>",
"preventAutoDeploy": True,
"isRemoteApplyEnabled": True,
"description": "<string>",
"retry": {
"onDestroy": {
"times": 123,
"errorRegex": "<string>"
},
"onDeploy": {
"times": 123,
"errorRegex": "<string>"
}
},
"runTestsOnPullRequest": True,
"isTerragruntRunAll": True,
"projectIds": ["<string>"],
"tagPrefix": "<string>",
"creationScopeId": "<string>",
"revision": "<string>",
"path": "<string>",
"fileName": "<string>",
"helmChartName": "<string>",
"terraformVersion": "<string>",
"opentofuVersion": "<string>",
"terragruntVersion": "<string>",
"pulumiVersion": "<string>",
"ansibleVersion": "<string>",
"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>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
projectId: '<string>',
organizationId: '<string>',
repository: '<string>',
deployRequest: {
comment: '<string>',
subEnvironments: {},
targets: ['<string>'],
gitUserData: {gitUser: '<string>', gitAvatarUrl: '<string>', prNumber: '<string>'}
},
workspaceName: '<string>',
requiresApproval: true,
configurationChanges: {
name: '<string>',
value: '<string>',
id: '<string>',
isSensitive: true,
isReadonly: true,
isRequired: true,
regex: '<string>',
toDelete: true,
projectId: '<string>',
schema: {enum: ['<string>']},
description: '<string>',
isOutput: true
},
configurationSetChanges: {assign: ['<string>'], unassign: ['<string>']},
continuousDeployment: true,
pullRequestPlanDeployments: true,
vcsPrCommentsEnabled: true,
vcsCommandsAlias: '<string>',
driftDetectionRequest: {enabled: true, cron: '<string>'},
autoDeployOnPathChangesOnly: true,
autoDeployByCustomGlob: '<string>',
terragruntWorkingDirectory: '<string>',
isRemoteBackend: true,
k8sNamespace: '<string>',
preventAutoDeploy: true,
isRemoteApplyEnabled: true,
description: '<string>',
retry: {
onDestroy: {times: 123, errorRegex: '<string>'},
onDeploy: {times: 123, errorRegex: '<string>'}
},
runTestsOnPullRequest: true,
isTerragruntRunAll: true,
projectIds: ['<string>'],
tagPrefix: '<string>',
creationScopeId: '<string>',
revision: '<string>',
path: '<string>',
fileName: '<string>',
helmChartName: '<string>',
terraformVersion: '<string>',
opentofuVersion: '<string>',
terragruntVersion: '<string>',
pulumiVersion: '<string>',
ansibleVersion: '<string>',
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>'
})
};
fetch('https://api.env0.com/environments/without-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.env0.com/environments/without-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'projectId' => '<string>',
'organizationId' => '<string>',
'repository' => '<string>',
'deployRequest' => [
'comment' => '<string>',
'subEnvironments' => [
],
'targets' => [
'<string>'
],
'gitUserData' => [
'gitUser' => '<string>',
'gitAvatarUrl' => '<string>',
'prNumber' => '<string>'
]
],
'workspaceName' => '<string>',
'requiresApproval' => true,
'configurationChanges' => [
'name' => '<string>',
'value' => '<string>',
'id' => '<string>',
'isSensitive' => true,
'isReadonly' => true,
'isRequired' => true,
'regex' => '<string>',
'toDelete' => true,
'projectId' => '<string>',
'schema' => [
'enum' => [
'<string>'
]
],
'description' => '<string>',
'isOutput' => true
],
'configurationSetChanges' => [
'assign' => [
'<string>'
],
'unassign' => [
'<string>'
]
],
'continuousDeployment' => true,
'pullRequestPlanDeployments' => true,
'vcsPrCommentsEnabled' => true,
'vcsCommandsAlias' => '<string>',
'driftDetectionRequest' => [
'enabled' => true,
'cron' => '<string>'
],
'autoDeployOnPathChangesOnly' => true,
'autoDeployByCustomGlob' => '<string>',
'terragruntWorkingDirectory' => '<string>',
'isRemoteBackend' => true,
'k8sNamespace' => '<string>',
'preventAutoDeploy' => true,
'isRemoteApplyEnabled' => true,
'description' => '<string>',
'retry' => [
'onDestroy' => [
'times' => 123,
'errorRegex' => '<string>'
],
'onDeploy' => [
'times' => 123,
'errorRegex' => '<string>'
]
],
'runTestsOnPullRequest' => true,
'isTerragruntRunAll' => true,
'projectIds' => [
'<string>'
],
'tagPrefix' => '<string>',
'creationScopeId' => '<string>',
'revision' => '<string>',
'path' => '<string>',
'fileName' => '<string>',
'helmChartName' => '<string>',
'terraformVersion' => '<string>',
'opentofuVersion' => '<string>',
'terragruntVersion' => '<string>',
'pulumiVersion' => '<string>',
'ansibleVersion' => '<string>',
'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>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.env0.com/environments/without-template"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"repository\": \"<string>\",\n \"deployRequest\": {\n \"comment\": \"<string>\",\n \"subEnvironments\": {},\n \"targets\": [\n \"<string>\"\n ],\n \"gitUserData\": {\n \"gitUser\": \"<string>\",\n \"gitAvatarUrl\": \"<string>\",\n \"prNumber\": \"<string>\"\n }\n },\n \"workspaceName\": \"<string>\",\n \"requiresApproval\": true,\n \"configurationChanges\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"id\": \"<string>\",\n \"isSensitive\": true,\n \"isReadonly\": true,\n \"isRequired\": true,\n \"regex\": \"<string>\",\n \"toDelete\": true,\n \"projectId\": \"<string>\",\n \"schema\": {\n \"enum\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"isOutput\": true\n },\n \"configurationSetChanges\": {\n \"assign\": [\n \"<string>\"\n ],\n \"unassign\": [\n \"<string>\"\n ]\n },\n \"continuousDeployment\": true,\n \"pullRequestPlanDeployments\": true,\n \"vcsPrCommentsEnabled\": true,\n \"vcsCommandsAlias\": \"<string>\",\n \"driftDetectionRequest\": {\n \"enabled\": true,\n \"cron\": \"<string>\"\n },\n \"autoDeployOnPathChangesOnly\": true,\n \"autoDeployByCustomGlob\": \"<string>\",\n \"terragruntWorkingDirectory\": \"<string>\",\n \"isRemoteBackend\": true,\n \"k8sNamespace\": \"<string>\",\n \"preventAutoDeploy\": true,\n \"isRemoteApplyEnabled\": true,\n \"description\": \"<string>\",\n \"retry\": {\n \"onDestroy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n },\n \"onDeploy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n }\n },\n \"runTestsOnPullRequest\": true,\n \"isTerragruntRunAll\": true,\n \"projectIds\": [\n \"<string>\"\n ],\n \"tagPrefix\": \"<string>\",\n \"creationScopeId\": \"<string>\",\n \"revision\": \"<string>\",\n \"path\": \"<string>\",\n \"fileName\": \"<string>\",\n \"helmChartName\": \"<string>\",\n \"terraformVersion\": \"<string>\",\n \"opentofuVersion\": \"<string>\",\n \"terragruntVersion\": \"<string>\",\n \"pulumiVersion\": \"<string>\",\n \"ansibleVersion\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"sshKeys\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isBitbucketServer\": true,\n \"isGitLabEnterprise\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isHelmRepository\": true,\n \"vcsConnectionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.env0.com/environments/without-template")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"repository\": \"<string>\",\n \"deployRequest\": {\n \"comment\": \"<string>\",\n \"subEnvironments\": {},\n \"targets\": [\n \"<string>\"\n ],\n \"gitUserData\": {\n \"gitUser\": \"<string>\",\n \"gitAvatarUrl\": \"<string>\",\n \"prNumber\": \"<string>\"\n }\n },\n \"workspaceName\": \"<string>\",\n \"requiresApproval\": true,\n \"configurationChanges\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"id\": \"<string>\",\n \"isSensitive\": true,\n \"isReadonly\": true,\n \"isRequired\": true,\n \"regex\": \"<string>\",\n \"toDelete\": true,\n \"projectId\": \"<string>\",\n \"schema\": {\n \"enum\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"isOutput\": true\n },\n \"configurationSetChanges\": {\n \"assign\": [\n \"<string>\"\n ],\n \"unassign\": [\n \"<string>\"\n ]\n },\n \"continuousDeployment\": true,\n \"pullRequestPlanDeployments\": true,\n \"vcsPrCommentsEnabled\": true,\n \"vcsCommandsAlias\": \"<string>\",\n \"driftDetectionRequest\": {\n \"enabled\": true,\n \"cron\": \"<string>\"\n },\n \"autoDeployOnPathChangesOnly\": true,\n \"autoDeployByCustomGlob\": \"<string>\",\n \"terragruntWorkingDirectory\": \"<string>\",\n \"isRemoteBackend\": true,\n \"k8sNamespace\": \"<string>\",\n \"preventAutoDeploy\": true,\n \"isRemoteApplyEnabled\": true,\n \"description\": \"<string>\",\n \"retry\": {\n \"onDestroy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n },\n \"onDeploy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n }\n },\n \"runTestsOnPullRequest\": true,\n \"isTerragruntRunAll\": true,\n \"projectIds\": [\n \"<string>\"\n ],\n \"tagPrefix\": \"<string>\",\n \"creationScopeId\": \"<string>\",\n \"revision\": \"<string>\",\n \"path\": \"<string>\",\n \"fileName\": \"<string>\",\n \"helmChartName\": \"<string>\",\n \"terraformVersion\": \"<string>\",\n \"opentofuVersion\": \"<string>\",\n \"terragruntVersion\": \"<string>\",\n \"pulumiVersion\": \"<string>\",\n \"ansibleVersion\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"sshKeys\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isBitbucketServer\": true,\n \"isGitLabEnterprise\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isHelmRepository\": true,\n \"vcsConnectionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.env0.com/environments/without-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"repository\": \"<string>\",\n \"deployRequest\": {\n \"comment\": \"<string>\",\n \"subEnvironments\": {},\n \"targets\": [\n \"<string>\"\n ],\n \"gitUserData\": {\n \"gitUser\": \"<string>\",\n \"gitAvatarUrl\": \"<string>\",\n \"prNumber\": \"<string>\"\n }\n },\n \"workspaceName\": \"<string>\",\n \"requiresApproval\": true,\n \"configurationChanges\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"id\": \"<string>\",\n \"isSensitive\": true,\n \"isReadonly\": true,\n \"isRequired\": true,\n \"regex\": \"<string>\",\n \"toDelete\": true,\n \"projectId\": \"<string>\",\n \"schema\": {\n \"enum\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"isOutput\": true\n },\n \"configurationSetChanges\": {\n \"assign\": [\n \"<string>\"\n ],\n \"unassign\": [\n \"<string>\"\n ]\n },\n \"continuousDeployment\": true,\n \"pullRequestPlanDeployments\": true,\n \"vcsPrCommentsEnabled\": true,\n \"vcsCommandsAlias\": \"<string>\",\n \"driftDetectionRequest\": {\n \"enabled\": true,\n \"cron\": \"<string>\"\n },\n \"autoDeployOnPathChangesOnly\": true,\n \"autoDeployByCustomGlob\": \"<string>\",\n \"terragruntWorkingDirectory\": \"<string>\",\n \"isRemoteBackend\": true,\n \"k8sNamespace\": \"<string>\",\n \"preventAutoDeploy\": true,\n \"isRemoteApplyEnabled\": true,\n \"description\": \"<string>\",\n \"retry\": {\n \"onDestroy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n },\n \"onDeploy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n }\n },\n \"runTestsOnPullRequest\": true,\n \"isTerragruntRunAll\": true,\n \"projectIds\": [\n \"<string>\"\n ],\n \"tagPrefix\": \"<string>\",\n \"creationScopeId\": \"<string>\",\n \"revision\": \"<string>\",\n \"path\": \"<string>\",\n \"fileName\": \"<string>\",\n \"helmChartName\": \"<string>\",\n \"terraformVersion\": \"<string>\",\n \"opentofuVersion\": \"<string>\",\n \"terragruntVersion\": \"<string>\",\n \"pulumiVersion\": \"<string>\",\n \"ansibleVersion\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"sshKeys\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isBitbucketServer\": true,\n \"isGitLabEnterprise\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isHelmRepository\": true,\n \"vcsConnectionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"blueprintId": "<string>",
"name": "<string>",
"organizationId": "<string>",
"projectId": "<string>",
"userId": "<string>",
"workspaceName": "<string>",
"user": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"requiresApproval": true,
"latestDeploymentLogId": "<string>",
"latestDeploymentLog": {
"startedBy": "<string>",
"queuedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"output": {},
"error": {},
"costEstimation": {
"totalMonthlyCost": 123,
"monthlyCostDiff": 123,
"projects": [
{
"diff": {
"totalMonthlyCost": "<string>"
}
}
]
},
"blueprintId": "<string>",
"blueprintName": "<string>",
"blueprintRepository": "<string>",
"blueprintRevision": "<string>",
"blueprintPath": "<string>",
"environmentId": "<string>",
"resourceCount": 123,
"startedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"isScheduledRun": true,
"abortedBy": "<string>",
"abortedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"reviewersUsers": [
{
"user": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
}
}
],
"reviewers": [
{
"userId": "<string>"
}
],
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"failedCommand": "<string>",
"customEnv0EnvironmentVariables": {
"environmentId": "<string>",
"projectId": "<string>",
"projectName": "<string>",
"parentProjectIds": "<string>",
"parentProjectPath": "<string>",
"deploymentLogId": "<string>",
"deploymentRevision": "<string>",
"workspaceName": "<string>",
"rootDir": "<string>",
"organizationId": "<string>",
"templateId": "<string>",
"templateDir": "<string>",
"templateName": "<string>",
"environmentName": "<string>",
"environmentCreatorName": "<string>",
"environmentCreatorUserId": "<string>",
"environmentCreatorEmail": "<string>",
"deployerName": "<string>",
"deployerUserId": "<string>",
"deployerEmail": "<string>",
"reviewerName": "<string>",
"reviewerEmail": "<string>",
"reviewerUserId": "<string>",
"prAuthor": "<string>",
"prNumber": "<string>",
"prSourceRepository": "<string>",
"prSourceBranch": "<string>",
"prTargetBranch": "<string>",
"commitHash": "<string>",
"commitUrl": "<string>",
"oidcToken": "<string>",
"vcsAccessToken": "<string>",
"tfPlanJson": "<string>",
"cliArgsPlan": "<string>",
"cliArgsApply": "<string>",
"discoveryRepositoryUrl": "<string>",
"discoveryPrNumber": "<string>"
},
"comment": "<string>",
"resources": [
{
"provider": "<string>",
"type": "<string>",
"name": "<string>",
"moduleName": "<string>"
}
],
"gitUser": "<string>",
"gitAvatarUrl": "<string>",
"prNumber": "<string>",
"driftDetected": true,
"plan": {
"resourceChanges": [
{
"name": "<string>",
"providerName": "<string>",
"type": "<string>",
"path": "<string>",
"attributes": [
{
"name": "<string>",
"before": "<unknown>",
"after": "<unknown>"
}
],
"id": "<string>",
"cloudId": "<string>",
"moduleName": "<string>",
"driftByCloud": true,
"importing": {
"id": "<string>"
},
"createBeforeDestroy": true,
"previousAddress": "<string>"
}
],
"outputChanges": [
{
"name": "<string>",
"attributes": [
{
"name": "<string>",
"before": "<unknown>",
"after": "<unknown>"
}
],
"moduleName": "<string>"
}
]
},
"planSummary": {
"added": 123,
"changed": 123,
"destroyed": 123,
"imported": 123
},
"isSkippedApply": true,
"workflowDeploymentId": "<string>",
"workflowFile": {
"environments": {},
"settings": {}
},
"workflowDeploymentOptions": {
"node": "<string>"
},
"stateVersionId": "<string>",
"reviewedBy": "<string>",
"reviewedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"targets": [
"<string>"
],
"variables": [
{
"name": "<string>",
"id": "<string>",
"scopeId": "<string>",
"value": "<string>",
"isSensitive": true,
"schema": {
"enum": [
"<string>"
]
},
"userId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"projectId": "<string>"
}
],
"gitMetadata": {
"commit": "<string>",
"branch": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"providerVersions": {},
"moduleVersions": {},
"stateFileHash": {
"value": "<string>"
},
"driftCause": {
"unappliedCommits": [
{
"userEmail": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"commitHash": "<string>"
}
]
}
},
"lifespanEndAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"nextScheduledDates": {
"deploy": "2023-11-07T05:31:56Z",
"destroy": "2023-11-07T05:31:56Z"
},
"continuousDeployment": true,
"pullRequestPlanDeployments": true,
"autoDeployOnPathChangesOnly": true,
"isRemoteBackend": true,
"isLocked": true,
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"vcsCommandsAlias": "<string>",
"vcsPrCommentsEnabled": true,
"autoDeployByCustomGlob": "<string>",
"terragruntWorkingDirectory": "<string>",
"isSingleUseBlueprint": true,
"workflowEnvironmentId": "<string>",
"lockStatus": {
"updatedBy": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"reason": "<string>",
"updatedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
}
},
"k8sNamespace": "<string>",
"isRemoteApplyEnabled": true
}Create an Environment Without Template
curl --request POST \
--url https://api.env0.com/environments/without-template \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"projectId": "<string>",
"organizationId": "<string>",
"repository": "<string>",
"deployRequest": {
"comment": "<string>",
"subEnvironments": {},
"targets": [
"<string>"
],
"gitUserData": {
"gitUser": "<string>",
"gitAvatarUrl": "<string>",
"prNumber": "<string>"
}
},
"workspaceName": "<string>",
"requiresApproval": true,
"configurationChanges": {
"name": "<string>",
"value": "<string>",
"id": "<string>",
"isSensitive": true,
"isReadonly": true,
"isRequired": true,
"regex": "<string>",
"toDelete": true,
"projectId": "<string>",
"schema": {
"enum": [
"<string>"
]
},
"description": "<string>",
"isOutput": true
},
"configurationSetChanges": {
"assign": [
"<string>"
],
"unassign": [
"<string>"
]
},
"continuousDeployment": true,
"pullRequestPlanDeployments": true,
"vcsPrCommentsEnabled": true,
"vcsCommandsAlias": "<string>",
"driftDetectionRequest": {
"enabled": true,
"cron": "<string>"
},
"autoDeployOnPathChangesOnly": true,
"autoDeployByCustomGlob": "<string>",
"terragruntWorkingDirectory": "<string>",
"isRemoteBackend": true,
"k8sNamespace": "<string>",
"preventAutoDeploy": true,
"isRemoteApplyEnabled": true,
"description": "<string>",
"retry": {
"onDestroy": {
"times": 123,
"errorRegex": "<string>"
},
"onDeploy": {
"times": 123,
"errorRegex": "<string>"
}
},
"runTestsOnPullRequest": true,
"isTerragruntRunAll": true,
"projectIds": [
"<string>"
],
"tagPrefix": "<string>",
"creationScopeId": "<string>",
"revision": "<string>",
"path": "<string>",
"fileName": "<string>",
"helmChartName": "<string>",
"terraformVersion": "<string>",
"opentofuVersion": "<string>",
"terragruntVersion": "<string>",
"pulumiVersion": "<string>",
"ansibleVersion": "<string>",
"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>"
}
'import requests
url = "https://api.env0.com/environments/without-template"
payload = {
"name": "<string>",
"projectId": "<string>",
"organizationId": "<string>",
"repository": "<string>",
"deployRequest": {
"comment": "<string>",
"subEnvironments": {},
"targets": ["<string>"],
"gitUserData": {
"gitUser": "<string>",
"gitAvatarUrl": "<string>",
"prNumber": "<string>"
}
},
"workspaceName": "<string>",
"requiresApproval": True,
"configurationChanges": {
"name": "<string>",
"value": "<string>",
"id": "<string>",
"isSensitive": True,
"isReadonly": True,
"isRequired": True,
"regex": "<string>",
"toDelete": True,
"projectId": "<string>",
"schema": { "enum": ["<string>"] },
"description": "<string>",
"isOutput": True
},
"configurationSetChanges": {
"assign": ["<string>"],
"unassign": ["<string>"]
},
"continuousDeployment": True,
"pullRequestPlanDeployments": True,
"vcsPrCommentsEnabled": True,
"vcsCommandsAlias": "<string>",
"driftDetectionRequest": {
"enabled": True,
"cron": "<string>"
},
"autoDeployOnPathChangesOnly": True,
"autoDeployByCustomGlob": "<string>",
"terragruntWorkingDirectory": "<string>",
"isRemoteBackend": True,
"k8sNamespace": "<string>",
"preventAutoDeploy": True,
"isRemoteApplyEnabled": True,
"description": "<string>",
"retry": {
"onDestroy": {
"times": 123,
"errorRegex": "<string>"
},
"onDeploy": {
"times": 123,
"errorRegex": "<string>"
}
},
"runTestsOnPullRequest": True,
"isTerragruntRunAll": True,
"projectIds": ["<string>"],
"tagPrefix": "<string>",
"creationScopeId": "<string>",
"revision": "<string>",
"path": "<string>",
"fileName": "<string>",
"helmChartName": "<string>",
"terraformVersion": "<string>",
"opentofuVersion": "<string>",
"terragruntVersion": "<string>",
"pulumiVersion": "<string>",
"ansibleVersion": "<string>",
"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>"
}
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
projectId: '<string>',
organizationId: '<string>',
repository: '<string>',
deployRequest: {
comment: '<string>',
subEnvironments: {},
targets: ['<string>'],
gitUserData: {gitUser: '<string>', gitAvatarUrl: '<string>', prNumber: '<string>'}
},
workspaceName: '<string>',
requiresApproval: true,
configurationChanges: {
name: '<string>',
value: '<string>',
id: '<string>',
isSensitive: true,
isReadonly: true,
isRequired: true,
regex: '<string>',
toDelete: true,
projectId: '<string>',
schema: {enum: ['<string>']},
description: '<string>',
isOutput: true
},
configurationSetChanges: {assign: ['<string>'], unassign: ['<string>']},
continuousDeployment: true,
pullRequestPlanDeployments: true,
vcsPrCommentsEnabled: true,
vcsCommandsAlias: '<string>',
driftDetectionRequest: {enabled: true, cron: '<string>'},
autoDeployOnPathChangesOnly: true,
autoDeployByCustomGlob: '<string>',
terragruntWorkingDirectory: '<string>',
isRemoteBackend: true,
k8sNamespace: '<string>',
preventAutoDeploy: true,
isRemoteApplyEnabled: true,
description: '<string>',
retry: {
onDestroy: {times: 123, errorRegex: '<string>'},
onDeploy: {times: 123, errorRegex: '<string>'}
},
runTestsOnPullRequest: true,
isTerragruntRunAll: true,
projectIds: ['<string>'],
tagPrefix: '<string>',
creationScopeId: '<string>',
revision: '<string>',
path: '<string>',
fileName: '<string>',
helmChartName: '<string>',
terraformVersion: '<string>',
opentofuVersion: '<string>',
terragruntVersion: '<string>',
pulumiVersion: '<string>',
ansibleVersion: '<string>',
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>'
})
};
fetch('https://api.env0.com/environments/without-template', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.env0.com/environments/without-template",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'projectId' => '<string>',
'organizationId' => '<string>',
'repository' => '<string>',
'deployRequest' => [
'comment' => '<string>',
'subEnvironments' => [
],
'targets' => [
'<string>'
],
'gitUserData' => [
'gitUser' => '<string>',
'gitAvatarUrl' => '<string>',
'prNumber' => '<string>'
]
],
'workspaceName' => '<string>',
'requiresApproval' => true,
'configurationChanges' => [
'name' => '<string>',
'value' => '<string>',
'id' => '<string>',
'isSensitive' => true,
'isReadonly' => true,
'isRequired' => true,
'regex' => '<string>',
'toDelete' => true,
'projectId' => '<string>',
'schema' => [
'enum' => [
'<string>'
]
],
'description' => '<string>',
'isOutput' => true
],
'configurationSetChanges' => [
'assign' => [
'<string>'
],
'unassign' => [
'<string>'
]
],
'continuousDeployment' => true,
'pullRequestPlanDeployments' => true,
'vcsPrCommentsEnabled' => true,
'vcsCommandsAlias' => '<string>',
'driftDetectionRequest' => [
'enabled' => true,
'cron' => '<string>'
],
'autoDeployOnPathChangesOnly' => true,
'autoDeployByCustomGlob' => '<string>',
'terragruntWorkingDirectory' => '<string>',
'isRemoteBackend' => true,
'k8sNamespace' => '<string>',
'preventAutoDeploy' => true,
'isRemoteApplyEnabled' => true,
'description' => '<string>',
'retry' => [
'onDestroy' => [
'times' => 123,
'errorRegex' => '<string>'
],
'onDeploy' => [
'times' => 123,
'errorRegex' => '<string>'
]
],
'runTestsOnPullRequest' => true,
'isTerragruntRunAll' => true,
'projectIds' => [
'<string>'
],
'tagPrefix' => '<string>',
'creationScopeId' => '<string>',
'revision' => '<string>',
'path' => '<string>',
'fileName' => '<string>',
'helmChartName' => '<string>',
'terraformVersion' => '<string>',
'opentofuVersion' => '<string>',
'terragruntVersion' => '<string>',
'pulumiVersion' => '<string>',
'ansibleVersion' => '<string>',
'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>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.env0.com/environments/without-template"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"repository\": \"<string>\",\n \"deployRequest\": {\n \"comment\": \"<string>\",\n \"subEnvironments\": {},\n \"targets\": [\n \"<string>\"\n ],\n \"gitUserData\": {\n \"gitUser\": \"<string>\",\n \"gitAvatarUrl\": \"<string>\",\n \"prNumber\": \"<string>\"\n }\n },\n \"workspaceName\": \"<string>\",\n \"requiresApproval\": true,\n \"configurationChanges\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"id\": \"<string>\",\n \"isSensitive\": true,\n \"isReadonly\": true,\n \"isRequired\": true,\n \"regex\": \"<string>\",\n \"toDelete\": true,\n \"projectId\": \"<string>\",\n \"schema\": {\n \"enum\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"isOutput\": true\n },\n \"configurationSetChanges\": {\n \"assign\": [\n \"<string>\"\n ],\n \"unassign\": [\n \"<string>\"\n ]\n },\n \"continuousDeployment\": true,\n \"pullRequestPlanDeployments\": true,\n \"vcsPrCommentsEnabled\": true,\n \"vcsCommandsAlias\": \"<string>\",\n \"driftDetectionRequest\": {\n \"enabled\": true,\n \"cron\": \"<string>\"\n },\n \"autoDeployOnPathChangesOnly\": true,\n \"autoDeployByCustomGlob\": \"<string>\",\n \"terragruntWorkingDirectory\": \"<string>\",\n \"isRemoteBackend\": true,\n \"k8sNamespace\": \"<string>\",\n \"preventAutoDeploy\": true,\n \"isRemoteApplyEnabled\": true,\n \"description\": \"<string>\",\n \"retry\": {\n \"onDestroy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n },\n \"onDeploy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n }\n },\n \"runTestsOnPullRequest\": true,\n \"isTerragruntRunAll\": true,\n \"projectIds\": [\n \"<string>\"\n ],\n \"tagPrefix\": \"<string>\",\n \"creationScopeId\": \"<string>\",\n \"revision\": \"<string>\",\n \"path\": \"<string>\",\n \"fileName\": \"<string>\",\n \"helmChartName\": \"<string>\",\n \"terraformVersion\": \"<string>\",\n \"opentofuVersion\": \"<string>\",\n \"terragruntVersion\": \"<string>\",\n \"pulumiVersion\": \"<string>\",\n \"ansibleVersion\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"sshKeys\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isBitbucketServer\": true,\n \"isGitLabEnterprise\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isHelmRepository\": true,\n \"vcsConnectionId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.env0.com/environments/without-template")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"repository\": \"<string>\",\n \"deployRequest\": {\n \"comment\": \"<string>\",\n \"subEnvironments\": {},\n \"targets\": [\n \"<string>\"\n ],\n \"gitUserData\": {\n \"gitUser\": \"<string>\",\n \"gitAvatarUrl\": \"<string>\",\n \"prNumber\": \"<string>\"\n }\n },\n \"workspaceName\": \"<string>\",\n \"requiresApproval\": true,\n \"configurationChanges\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"id\": \"<string>\",\n \"isSensitive\": true,\n \"isReadonly\": true,\n \"isRequired\": true,\n \"regex\": \"<string>\",\n \"toDelete\": true,\n \"projectId\": \"<string>\",\n \"schema\": {\n \"enum\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"isOutput\": true\n },\n \"configurationSetChanges\": {\n \"assign\": [\n \"<string>\"\n ],\n \"unassign\": [\n \"<string>\"\n ]\n },\n \"continuousDeployment\": true,\n \"pullRequestPlanDeployments\": true,\n \"vcsPrCommentsEnabled\": true,\n \"vcsCommandsAlias\": \"<string>\",\n \"driftDetectionRequest\": {\n \"enabled\": true,\n \"cron\": \"<string>\"\n },\n \"autoDeployOnPathChangesOnly\": true,\n \"autoDeployByCustomGlob\": \"<string>\",\n \"terragruntWorkingDirectory\": \"<string>\",\n \"isRemoteBackend\": true,\n \"k8sNamespace\": \"<string>\",\n \"preventAutoDeploy\": true,\n \"isRemoteApplyEnabled\": true,\n \"description\": \"<string>\",\n \"retry\": {\n \"onDestroy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n },\n \"onDeploy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n }\n },\n \"runTestsOnPullRequest\": true,\n \"isTerragruntRunAll\": true,\n \"projectIds\": [\n \"<string>\"\n ],\n \"tagPrefix\": \"<string>\",\n \"creationScopeId\": \"<string>\",\n \"revision\": \"<string>\",\n \"path\": \"<string>\",\n \"fileName\": \"<string>\",\n \"helmChartName\": \"<string>\",\n \"terraformVersion\": \"<string>\",\n \"opentofuVersion\": \"<string>\",\n \"terragruntVersion\": \"<string>\",\n \"pulumiVersion\": \"<string>\",\n \"ansibleVersion\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"sshKeys\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isBitbucketServer\": true,\n \"isGitLabEnterprise\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isHelmRepository\": true,\n \"vcsConnectionId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.env0.com/environments/without-template")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"projectId\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"repository\": \"<string>\",\n \"deployRequest\": {\n \"comment\": \"<string>\",\n \"subEnvironments\": {},\n \"targets\": [\n \"<string>\"\n ],\n \"gitUserData\": {\n \"gitUser\": \"<string>\",\n \"gitAvatarUrl\": \"<string>\",\n \"prNumber\": \"<string>\"\n }\n },\n \"workspaceName\": \"<string>\",\n \"requiresApproval\": true,\n \"configurationChanges\": {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"id\": \"<string>\",\n \"isSensitive\": true,\n \"isReadonly\": true,\n \"isRequired\": true,\n \"regex\": \"<string>\",\n \"toDelete\": true,\n \"projectId\": \"<string>\",\n \"schema\": {\n \"enum\": [\n \"<string>\"\n ]\n },\n \"description\": \"<string>\",\n \"isOutput\": true\n },\n \"configurationSetChanges\": {\n \"assign\": [\n \"<string>\"\n ],\n \"unassign\": [\n \"<string>\"\n ]\n },\n \"continuousDeployment\": true,\n \"pullRequestPlanDeployments\": true,\n \"vcsPrCommentsEnabled\": true,\n \"vcsCommandsAlias\": \"<string>\",\n \"driftDetectionRequest\": {\n \"enabled\": true,\n \"cron\": \"<string>\"\n },\n \"autoDeployOnPathChangesOnly\": true,\n \"autoDeployByCustomGlob\": \"<string>\",\n \"terragruntWorkingDirectory\": \"<string>\",\n \"isRemoteBackend\": true,\n \"k8sNamespace\": \"<string>\",\n \"preventAutoDeploy\": true,\n \"isRemoteApplyEnabled\": true,\n \"description\": \"<string>\",\n \"retry\": {\n \"onDestroy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n },\n \"onDeploy\": {\n \"times\": 123,\n \"errorRegex\": \"<string>\"\n }\n },\n \"runTestsOnPullRequest\": true,\n \"isTerragruntRunAll\": true,\n \"projectIds\": [\n \"<string>\"\n ],\n \"tagPrefix\": \"<string>\",\n \"creationScopeId\": \"<string>\",\n \"revision\": \"<string>\",\n \"path\": \"<string>\",\n \"fileName\": \"<string>\",\n \"helmChartName\": \"<string>\",\n \"terraformVersion\": \"<string>\",\n \"opentofuVersion\": \"<string>\",\n \"terragruntVersion\": \"<string>\",\n \"pulumiVersion\": \"<string>\",\n \"ansibleVersion\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"sshKeys\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isBitbucketServer\": true,\n \"isGitLabEnterprise\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isHelmRepository\": true,\n \"vcsConnectionId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"blueprintId": "<string>",
"name": "<string>",
"organizationId": "<string>",
"projectId": "<string>",
"userId": "<string>",
"workspaceName": "<string>",
"user": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"requiresApproval": true,
"latestDeploymentLogId": "<string>",
"latestDeploymentLog": {
"startedBy": "<string>",
"queuedAt": "2023-11-07T05:31:56Z",
"startedAt": "2023-11-07T05:31:56Z",
"finishedAt": "2023-11-07T05:31:56Z",
"output": {},
"error": {},
"costEstimation": {
"totalMonthlyCost": 123,
"monthlyCostDiff": 123,
"projects": [
{
"diff": {
"totalMonthlyCost": "<string>"
}
}
]
},
"blueprintId": "<string>",
"blueprintName": "<string>",
"blueprintRepository": "<string>",
"blueprintRevision": "<string>",
"blueprintPath": "<string>",
"environmentId": "<string>",
"resourceCount": 123,
"startedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"isScheduledRun": true,
"abortedBy": "<string>",
"abortedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"reviewersUsers": [
{
"user": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
}
}
],
"reviewers": [
{
"userId": "<string>"
}
],
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"failedCommand": "<string>",
"customEnv0EnvironmentVariables": {
"environmentId": "<string>",
"projectId": "<string>",
"projectName": "<string>",
"parentProjectIds": "<string>",
"parentProjectPath": "<string>",
"deploymentLogId": "<string>",
"deploymentRevision": "<string>",
"workspaceName": "<string>",
"rootDir": "<string>",
"organizationId": "<string>",
"templateId": "<string>",
"templateDir": "<string>",
"templateName": "<string>",
"environmentName": "<string>",
"environmentCreatorName": "<string>",
"environmentCreatorUserId": "<string>",
"environmentCreatorEmail": "<string>",
"deployerName": "<string>",
"deployerUserId": "<string>",
"deployerEmail": "<string>",
"reviewerName": "<string>",
"reviewerEmail": "<string>",
"reviewerUserId": "<string>",
"prAuthor": "<string>",
"prNumber": "<string>",
"prSourceRepository": "<string>",
"prSourceBranch": "<string>",
"prTargetBranch": "<string>",
"commitHash": "<string>",
"commitUrl": "<string>",
"oidcToken": "<string>",
"vcsAccessToken": "<string>",
"tfPlanJson": "<string>",
"cliArgsPlan": "<string>",
"cliArgsApply": "<string>",
"discoveryRepositoryUrl": "<string>",
"discoveryPrNumber": "<string>"
},
"comment": "<string>",
"resources": [
{
"provider": "<string>",
"type": "<string>",
"name": "<string>",
"moduleName": "<string>"
}
],
"gitUser": "<string>",
"gitAvatarUrl": "<string>",
"prNumber": "<string>",
"driftDetected": true,
"plan": {
"resourceChanges": [
{
"name": "<string>",
"providerName": "<string>",
"type": "<string>",
"path": "<string>",
"attributes": [
{
"name": "<string>",
"before": "<unknown>",
"after": "<unknown>"
}
],
"id": "<string>",
"cloudId": "<string>",
"moduleName": "<string>",
"driftByCloud": true,
"importing": {
"id": "<string>"
},
"createBeforeDestroy": true,
"previousAddress": "<string>"
}
],
"outputChanges": [
{
"name": "<string>",
"attributes": [
{
"name": "<string>",
"before": "<unknown>",
"after": "<unknown>"
}
],
"moduleName": "<string>"
}
]
},
"planSummary": {
"added": 123,
"changed": 123,
"destroyed": 123,
"imported": 123
},
"isSkippedApply": true,
"workflowDeploymentId": "<string>",
"workflowFile": {
"environments": {},
"settings": {}
},
"workflowDeploymentOptions": {
"node": "<string>"
},
"stateVersionId": "<string>",
"reviewedBy": "<string>",
"reviewedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
},
"targets": [
"<string>"
],
"variables": [
{
"name": "<string>",
"id": "<string>",
"scopeId": "<string>",
"value": "<string>",
"isSensitive": true,
"schema": {
"enum": [
"<string>"
]
},
"userId": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"projectId": "<string>"
}
],
"gitMetadata": {
"commit": "<string>",
"branch": "<string>",
"timestamp": "2023-11-07T05:31:56Z"
},
"providerVersions": {},
"moduleVersions": {},
"stateFileHash": {
"value": "<string>"
},
"driftCause": {
"unappliedCommits": [
{
"userEmail": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"commitHash": "<string>"
}
]
}
},
"lifespanEndAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"nextScheduledDates": {
"deploy": "2023-11-07T05:31:56Z",
"destroy": "2023-11-07T05:31:56Z"
},
"continuousDeployment": true,
"pullRequestPlanDeployments": true,
"autoDeployOnPathChangesOnly": true,
"isRemoteBackend": true,
"isLocked": true,
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"vcsCommandsAlias": "<string>",
"vcsPrCommentsEnabled": true,
"autoDeployByCustomGlob": "<string>",
"terragruntWorkingDirectory": "<string>",
"isSingleUseBlueprint": true,
"workflowEnvironmentId": "<string>",
"lockStatus": {
"updatedBy": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"reason": "<string>",
"updatedByUser": {
"email": "<string>",
"user_id": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"app_metadata": {
"organizations": [
{
"id": "<string>",
"role": "<string>",
"name": "<string>"
}
],
"isApiKey": true,
"isAutogeneratedTerraformDeployer": true,
"apiKeyType": "<string>",
"createdBy": "<string>",
"organizationId": "<string>",
"isSystemUser": true,
"readOnly": true
},
"picture": "<string>",
"name": "<string>",
"last_login": "<string>",
"given_name": "<string>",
"family_name": "<string>",
"blocked": true
}
},
"k8sNamespace": "<string>",
"isRemoteApplyEnabled": true
}Authorizations
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.
Body
1opentofu, terraform, terragrunt, pulumi, k8s, cloudformation, helm, ansible, opentofu, terraform, terragrunt, pulumi, k8s, cloudformation, helm, ansible, opentofu, terraform, terragrunt, pulumi, k8s, cloudformation, helm, ansible, opentofu, terraform, terragrunt, pulumi, k8s, cloudformation, helm, ansible, opentofu, terraform, terragrunt, pulumi, k8s, cloudformation, helm, ansible Show child attributes
Show child attributes
Show child attributes
Show child attributes
Manage variables in the environment. Either a single variable or an array of variables.
- object
- object[]
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
ORGANIZATION, PROJECT, ORGANIZATION, PROJECT, ORGANIZATION, PROJECT 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.
terraform, opentofu, terraform, opentofu, terraform, opentofu Show child attributes
Show child attributes
Response
Show child attributes
Show child attributes
CREATED, INACTIVE, ACTIVE, FAILED, TIMEOUT, WAITING_FOR_USER, DEPLOY_IN_PROGRESS, DESTROY_IN_PROGRESS, TASK_IN_PROGRESS, ABORTING, ABORTED, NEVER_DEPLOYED, DRIFTED, DRY_RUN_IN_PROGRESS, CREATED, INACTIVE, ACTIVE, FAILED, TIMEOUT, WAITING_FOR_USER, DEPLOY_IN_PROGRESS, DESTROY_IN_PROGRESS, TASK_IN_PROGRESS, ABORTING, ABORTED, NEVER_DEPLOYED, DRIFTED, DRY_RUN_IN_PROGRESS, CREATED, INACTIVE, ACTIVE, FAILED, TIMEOUT, WAITING_FOR_USER, DEPLOY_IN_PROGRESS, DESTROY_IN_PROGRESS, TASK_IN_PROGRESS, ABORTING, ABORTED, NEVER_DEPLOYED, DRIFTED, DRY_RUN_IN_PROGRESS Show child attributes
Show child attributes
0, 1, 2, 3, 0, 1, 2, 3 Mark the environment as inactive
Show child attributes
Show child attributes
ERROR, DRIFTED, OK, NEVER_RUN, DISABLED, ERROR, DRIFTED, OK, NEVER_RUN, DISABLED, ERROR, DRIFTED, OK, NEVER_RUN, DISABLED Show child attributes
Show child attributes
Was this page helpful?