curl --request POST \
--url https://api.env0.com/modules \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": "<string>",
"type": "<string>",
"repository": "<string>",
"moduleName": "<string>",
"moduleProvider": "<string>",
"author": {
"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
},
"authorId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"description": "<string>",
"tokenId": "<string>",
"tokenName": "<string>",
"githubInstallationId": 123,
"bitbucketClientKey": "<string>",
"isGitLab": true,
"isAzureDevOps": true,
"isBitbucketServer": true,
"isGitHubEnterprise": true,
"isGitLabEnterprise": true,
"path": "<string>",
"runTestsOnPullRequest": true,
"opentofuVersion": "<string>",
"tagPrefix": "<string>",
"vcsConnectionId": "<string>",
"moduleTestEnabled": true
}
'import requests
url = "https://api.env0.com/modules"
payload = {
"organizationId": "<string>",
"type": "<string>",
"repository": "<string>",
"moduleName": "<string>",
"moduleProvider": "<string>",
"author": {
"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
},
"authorId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": True,
"description": "<string>",
"tokenId": "<string>",
"tokenName": "<string>",
"githubInstallationId": 123,
"bitbucketClientKey": "<string>",
"isGitLab": True,
"isAzureDevOps": True,
"isBitbucketServer": True,
"isGitHubEnterprise": True,
"isGitLabEnterprise": True,
"path": "<string>",
"runTestsOnPullRequest": True,
"opentofuVersion": "<string>",
"tagPrefix": "<string>",
"vcsConnectionId": "<string>",
"moduleTestEnabled": True
}
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({
organizationId: '<string>',
type: '<string>',
repository: '<string>',
moduleName: '<string>',
moduleProvider: '<string>',
author: {
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
},
authorId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
isDeleted: true,
description: '<string>',
tokenId: '<string>',
tokenName: '<string>',
githubInstallationId: 123,
bitbucketClientKey: '<string>',
isGitLab: true,
isAzureDevOps: true,
isBitbucketServer: true,
isGitHubEnterprise: true,
isGitLabEnterprise: true,
path: '<string>',
runTestsOnPullRequest: true,
opentofuVersion: '<string>',
tagPrefix: '<string>',
vcsConnectionId: '<string>',
moduleTestEnabled: true
})
};
fetch('https://api.env0.com/modules', 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/modules",
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([
'organizationId' => '<string>',
'type' => '<string>',
'repository' => '<string>',
'moduleName' => '<string>',
'moduleProvider' => '<string>',
'author' => [
'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
],
'authorId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'isDeleted' => true,
'description' => '<string>',
'tokenId' => '<string>',
'tokenName' => '<string>',
'githubInstallationId' => 123,
'bitbucketClientKey' => '<string>',
'isGitLab' => true,
'isAzureDevOps' => true,
'isBitbucketServer' => true,
'isGitHubEnterprise' => true,
'isGitLabEnterprise' => true,
'path' => '<string>',
'runTestsOnPullRequest' => true,
'opentofuVersion' => '<string>',
'tagPrefix' => '<string>',
'vcsConnectionId' => '<string>',
'moduleTestEnabled' => true
]),
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/modules"
payload := strings.NewReader("{\n \"organizationId\": \"<string>\",\n \"type\": \"<string>\",\n \"repository\": \"<string>\",\n \"moduleName\": \"<string>\",\n \"moduleProvider\": \"<string>\",\n \"author\": {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"updated_at\": \"<string>\",\n \"app_metadata\": {\n \"organizations\": [\n {\n \"id\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"isApiKey\": true,\n \"isAutogeneratedTerraformDeployer\": true,\n \"apiKeyType\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"isSystemUser\": true,\n \"readOnly\": true\n },\n \"picture\": \"<string>\",\n \"name\": \"<string>\",\n \"last_login\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"blocked\": true\n },\n \"authorId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"isDeleted\": true,\n \"description\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isBitbucketServer\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLabEnterprise\": true,\n \"path\": \"<string>\",\n \"runTestsOnPullRequest\": true,\n \"opentofuVersion\": \"<string>\",\n \"tagPrefix\": \"<string>\",\n \"vcsConnectionId\": \"<string>\",\n \"moduleTestEnabled\": true\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/modules")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"organizationId\": \"<string>\",\n \"type\": \"<string>\",\n \"repository\": \"<string>\",\n \"moduleName\": \"<string>\",\n \"moduleProvider\": \"<string>\",\n \"author\": {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"updated_at\": \"<string>\",\n \"app_metadata\": {\n \"organizations\": [\n {\n \"id\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"isApiKey\": true,\n \"isAutogeneratedTerraformDeployer\": true,\n \"apiKeyType\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"isSystemUser\": true,\n \"readOnly\": true\n },\n \"picture\": \"<string>\",\n \"name\": \"<string>\",\n \"last_login\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"blocked\": true\n },\n \"authorId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"isDeleted\": true,\n \"description\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isBitbucketServer\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLabEnterprise\": true,\n \"path\": \"<string>\",\n \"runTestsOnPullRequest\": true,\n \"opentofuVersion\": \"<string>\",\n \"tagPrefix\": \"<string>\",\n \"vcsConnectionId\": \"<string>\",\n \"moduleTestEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.env0.com/modules")
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 \"organizationId\": \"<string>\",\n \"type\": \"<string>\",\n \"repository\": \"<string>\",\n \"moduleName\": \"<string>\",\n \"moduleProvider\": \"<string>\",\n \"author\": {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"updated_at\": \"<string>\",\n \"app_metadata\": {\n \"organizations\": [\n {\n \"id\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"isApiKey\": true,\n \"isAutogeneratedTerraformDeployer\": true,\n \"apiKeyType\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"isSystemUser\": true,\n \"readOnly\": true\n },\n \"picture\": \"<string>\",\n \"name\": \"<string>\",\n \"last_login\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"blocked\": true\n },\n \"authorId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"isDeleted\": true,\n \"description\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isBitbucketServer\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLabEnterprise\": true,\n \"path\": \"<string>\",\n \"runTestsOnPullRequest\": true,\n \"opentofuVersion\": \"<string>\",\n \"tagPrefix\": \"<string>\",\n \"vcsConnectionId\": \"<string>\",\n \"moduleTestEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"moduleName": "<string>",
"moduleProvider": "<string>",
"repository": "<string>",
"type": "<string>",
"organizationId": "<string>",
"moduleTestEnabled": true,
"description": "<string>",
"tokenId": "<string>",
"tokenName": "<string>",
"githubInstallationId": 123,
"bitbucketClientKey": "<string>",
"isGitLab": true,
"isAzureDevOps": true,
"isBitbucketServer": true,
"isGitHubEnterprise": true,
"isGitLabEnterprise": true,
"path": "<string>",
"runTestsOnPullRequest": true,
"opentofuVersion": "<string>",
"tagPrefix": "<string>",
"vcsConnectionId": "<string>",
"testingEnvironmentId": "<string>",
"id": "<string>",
"author": {
"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
},
"authorId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": true
}Create module
curl --request POST \
--url https://api.env0.com/modules \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationId": "<string>",
"type": "<string>",
"repository": "<string>",
"moduleName": "<string>",
"moduleProvider": "<string>",
"author": {
"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
},
"authorId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": true,
"description": "<string>",
"tokenId": "<string>",
"tokenName": "<string>",
"githubInstallationId": 123,
"bitbucketClientKey": "<string>",
"isGitLab": true,
"isAzureDevOps": true,
"isBitbucketServer": true,
"isGitHubEnterprise": true,
"isGitLabEnterprise": true,
"path": "<string>",
"runTestsOnPullRequest": true,
"opentofuVersion": "<string>",
"tagPrefix": "<string>",
"vcsConnectionId": "<string>",
"moduleTestEnabled": true
}
'import requests
url = "https://api.env0.com/modules"
payload = {
"organizationId": "<string>",
"type": "<string>",
"repository": "<string>",
"moduleName": "<string>",
"moduleProvider": "<string>",
"author": {
"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
},
"authorId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": True,
"description": "<string>",
"tokenId": "<string>",
"tokenName": "<string>",
"githubInstallationId": 123,
"bitbucketClientKey": "<string>",
"isGitLab": True,
"isAzureDevOps": True,
"isBitbucketServer": True,
"isGitHubEnterprise": True,
"isGitLabEnterprise": True,
"path": "<string>",
"runTestsOnPullRequest": True,
"opentofuVersion": "<string>",
"tagPrefix": "<string>",
"vcsConnectionId": "<string>",
"moduleTestEnabled": True
}
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({
organizationId: '<string>',
type: '<string>',
repository: '<string>',
moduleName: '<string>',
moduleProvider: '<string>',
author: {
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
},
authorId: '<string>',
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
isDeleted: true,
description: '<string>',
tokenId: '<string>',
tokenName: '<string>',
githubInstallationId: 123,
bitbucketClientKey: '<string>',
isGitLab: true,
isAzureDevOps: true,
isBitbucketServer: true,
isGitHubEnterprise: true,
isGitLabEnterprise: true,
path: '<string>',
runTestsOnPullRequest: true,
opentofuVersion: '<string>',
tagPrefix: '<string>',
vcsConnectionId: '<string>',
moduleTestEnabled: true
})
};
fetch('https://api.env0.com/modules', 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/modules",
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([
'organizationId' => '<string>',
'type' => '<string>',
'repository' => '<string>',
'moduleName' => '<string>',
'moduleProvider' => '<string>',
'author' => [
'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
],
'authorId' => '<string>',
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'isDeleted' => true,
'description' => '<string>',
'tokenId' => '<string>',
'tokenName' => '<string>',
'githubInstallationId' => 123,
'bitbucketClientKey' => '<string>',
'isGitLab' => true,
'isAzureDevOps' => true,
'isBitbucketServer' => true,
'isGitHubEnterprise' => true,
'isGitLabEnterprise' => true,
'path' => '<string>',
'runTestsOnPullRequest' => true,
'opentofuVersion' => '<string>',
'tagPrefix' => '<string>',
'vcsConnectionId' => '<string>',
'moduleTestEnabled' => true
]),
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/modules"
payload := strings.NewReader("{\n \"organizationId\": \"<string>\",\n \"type\": \"<string>\",\n \"repository\": \"<string>\",\n \"moduleName\": \"<string>\",\n \"moduleProvider\": \"<string>\",\n \"author\": {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"updated_at\": \"<string>\",\n \"app_metadata\": {\n \"organizations\": [\n {\n \"id\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"isApiKey\": true,\n \"isAutogeneratedTerraformDeployer\": true,\n \"apiKeyType\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"isSystemUser\": true,\n \"readOnly\": true\n },\n \"picture\": \"<string>\",\n \"name\": \"<string>\",\n \"last_login\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"blocked\": true\n },\n \"authorId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"isDeleted\": true,\n \"description\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isBitbucketServer\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLabEnterprise\": true,\n \"path\": \"<string>\",\n \"runTestsOnPullRequest\": true,\n \"opentofuVersion\": \"<string>\",\n \"tagPrefix\": \"<string>\",\n \"vcsConnectionId\": \"<string>\",\n \"moduleTestEnabled\": true\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/modules")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"organizationId\": \"<string>\",\n \"type\": \"<string>\",\n \"repository\": \"<string>\",\n \"moduleName\": \"<string>\",\n \"moduleProvider\": \"<string>\",\n \"author\": {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"updated_at\": \"<string>\",\n \"app_metadata\": {\n \"organizations\": [\n {\n \"id\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"isApiKey\": true,\n \"isAutogeneratedTerraformDeployer\": true,\n \"apiKeyType\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"isSystemUser\": true,\n \"readOnly\": true\n },\n \"picture\": \"<string>\",\n \"name\": \"<string>\",\n \"last_login\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"blocked\": true\n },\n \"authorId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"isDeleted\": true,\n \"description\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isBitbucketServer\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLabEnterprise\": true,\n \"path\": \"<string>\",\n \"runTestsOnPullRequest\": true,\n \"opentofuVersion\": \"<string>\",\n \"tagPrefix\": \"<string>\",\n \"vcsConnectionId\": \"<string>\",\n \"moduleTestEnabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.env0.com/modules")
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 \"organizationId\": \"<string>\",\n \"type\": \"<string>\",\n \"repository\": \"<string>\",\n \"moduleName\": \"<string>\",\n \"moduleProvider\": \"<string>\",\n \"author\": {\n \"email\": \"<string>\",\n \"user_id\": \"<string>\",\n \"created_at\": \"<string>\",\n \"updated_at\": \"<string>\",\n \"app_metadata\": {\n \"organizations\": [\n {\n \"id\": \"<string>\",\n \"role\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"isApiKey\": true,\n \"isAutogeneratedTerraformDeployer\": true,\n \"apiKeyType\": \"<string>\",\n \"createdBy\": \"<string>\",\n \"organizationId\": \"<string>\",\n \"isSystemUser\": true,\n \"readOnly\": true\n },\n \"picture\": \"<string>\",\n \"name\": \"<string>\",\n \"last_login\": \"<string>\",\n \"given_name\": \"<string>\",\n \"family_name\": \"<string>\",\n \"blocked\": true\n },\n \"authorId\": \"<string>\",\n \"createdAt\": \"2023-11-07T05:31:56Z\",\n \"updatedAt\": \"2023-11-07T05:31:56Z\",\n \"isDeleted\": true,\n \"description\": \"<string>\",\n \"tokenId\": \"<string>\",\n \"tokenName\": \"<string>\",\n \"githubInstallationId\": 123,\n \"bitbucketClientKey\": \"<string>\",\n \"isGitLab\": true,\n \"isAzureDevOps\": true,\n \"isBitbucketServer\": true,\n \"isGitHubEnterprise\": true,\n \"isGitLabEnterprise\": true,\n \"path\": \"<string>\",\n \"runTestsOnPullRequest\": true,\n \"opentofuVersion\": \"<string>\",\n \"tagPrefix\": \"<string>\",\n \"vcsConnectionId\": \"<string>\",\n \"moduleTestEnabled\": true\n}"
response = http.request(request)
puts response.read_body{
"moduleName": "<string>",
"moduleProvider": "<string>",
"repository": "<string>",
"type": "<string>",
"organizationId": "<string>",
"moduleTestEnabled": true,
"description": "<string>",
"tokenId": "<string>",
"tokenName": "<string>",
"githubInstallationId": 123,
"bitbucketClientKey": "<string>",
"isGitLab": true,
"isAzureDevOps": true,
"isBitbucketServer": true,
"isGitHubEnterprise": true,
"isGitLabEnterprise": true,
"path": "<string>",
"runTestsOnPullRequest": true,
"opentofuVersion": "<string>",
"tagPrefix": "<string>",
"vcsConnectionId": "<string>",
"testingEnvironmentId": "<string>",
"id": "<string>",
"author": {
"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
},
"authorId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isDeleted": 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
"module"Module Name. Can be made of up to 64 characters, containing alphanumeric, hyphens and underscores. Must not contain leading/trailing hyphens/underscores.
^[0-9A-Za-z](?:[0-9A-Za-z-_]{0,62}[0-9A-Za-z])?$ *Module Provider. Can be made of up to 64 characters, containing lowercase alphanumeric characters only.
^[0-9a-z]{0,64}$ *Show child attributes
Show child attributes
Response
Module Name. Can be made of up to 64 characters, containing alphanumeric, hyphens and underscores. Must not contain leading/trailing hyphens/underscores.
^[0-9A-Za-z](?:[0-9A-Za-z-_]{0,62}[0-9A-Za-z])?$ *Module Provider. Can be made of up to 64 characters, containing lowercase alphanumeric characters only.
^[0-9a-z]{0,64}$ *"module"Show child attributes
Show child attributes
Was this page helpful?