• Overview
    • Enforce Policy as Code
    • Infrastructure as Code
    • Inject Secrets into Terraform
    • Integrate with Existing Workflows
    • Manage Kubernetes
    • Manage Virtual Machine Images
    • Multi-Cloud Deployment
    • Network Infrastructure Automation
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
  • Registry
  • Tutorials
    • About the Docs
    • Intro to Terraform
    • Configuration Language
    • Terraform CLI
    • Terraform Cloud
    • Terraform Enterprise
    • Provider Use
    • Plugin Development
    • Registry Publishing
    • Integration Program
    • Terraform Tools
    • CDK for Terraform
    • Glossary
  • Community
GitHubTerraform Cloud
Download

    Terraform Cloud and Enterprise

  • Overview
  • Plans and Features
  • Getting Started
    • API Docs template
    • Overview
    • Account
    • Agent Pools
    • Agent Tokens
    • Applies
    • Audit Trails
    • Comments
    • Configuration Versions
    • Cost Estimates
    • Feature Sets
    • Invoices
    • IP Ranges
    • Notification Configurations
    • OAuth Clients
    • OAuth Tokens
    • Organizations
    • Organization Memberships
    • Organization Tags
    • Organization Tokens
    • Plan Exports
    • Plans
    • Policies
    • Policy Checks
    • Policy Sets
    • Policy Set Parameters
      • Modules
      • Providers
      • Private Provider Versions and Platforms
      • GPG Keys
    • Runs
      • Run Tasks
      • Stages and Results
      • Custom Integration
    • Run Triggers
    • SSH Keys
    • State Versions
    • State Version Outputs
    • Subscriptions
    • Team Access
    • Team Membership
    • Team Tokens
    • Teams
    • User Tokens
    • Users
    • Variables
    • VCS Events
    • Workspaces
    • Workspace-Specific Variables
    • Workspace Resources
    • Variable Sets
      • Overview
      • Module Sharing
      • Organizations
      • Runs
      • Settings
      • Terraform Versions
      • Users
      • Workspaces
    • Changelog
    • Stability Policy
    • Overview
    • Creating Workspaces
    • Naming
    • Terraform Configurations
      • Overview
      • Managing Variables
      • Overview
      • VCS Connections
      • Access
      • Drift Detection
      • Notifications
      • SSH Keys for Modules
      • Run Triggers
      • Run Tasks
    • Terraform State
    • JSON Filtering
    • Remote Operations
    • Viewing and Managing Runs
    • Run States and Stages
    • Run Modes and Options
    • UI/VCS-driven Runs
    • API-driven Runs
    • CLI-driven Runs
    • The Run Environment
    • Installing Software
    • Users
    • Teams
    • Organizations
    • Permissions
    • Two-factor Authentication
    • API Tokens
      • Overview
      • Microsoft Azure AD
      • Okta
      • SAML
      • Linking a User Account
      • Testing
    • Overview
    • GitHub.com
    • GitHub.com (OAuth)
    • GitHub Enterprise
    • GitLab.com
    • GitLab EE and CE
    • Bitbucket Cloud
    • Bitbucket Server and Data Center
    • Azure DevOps Services
    • Azure DevOps Server
    • Troubleshooting
    • Overview
    • Adding Public Providers and Modules
    • Publishing Private Providers
    • Publishing Private Modules
    • Using Providers and Modules
    • Configuration Designer
  • Migrating to Terraform Cloud
    • Overview
    • Using Sentinel with Terraform 0.12
    • Manage Policies
    • Enforce and Override Policies
    • Mocking Terraform Sentinel Data
    • Working With JSON Result Data
      • Overview
      • tfconfig
      • tfconfig/v2
      • tfplan
      • tfplan/v2
      • tfstate
      • tfstate/v2
      • tfrun
    • Example Policies
    • Overview
    • AWS
    • GCP
    • Azure
      • Overview
      • Service Catalog
      • Admin Guide
      • Developer Reference
      • Example Customizations
      • V1 Setup Instructions
    • Splunk Integration
    • Kubernetes Integration
    • Run Tasks Integration
    • Overview
    • IP Ranges
    • Data Security
    • Security Model
    • Overview
    • Part 1: Overview of Our Recommended Workflow
    • Part 2: Evaluating Your Current Provisioning Practices
    • Part 3: How to Evolve Your Provisioning Practices
    • Part 3.1: From Manual Changes to Semi-Automation
    • Part 3.2: From Semi-Automation to Infrastructure as Code
    • Part 3.3: From Infrastructure as Code to Collaborative Infrastructure as Code
    • Part 3.4: Advanced Workflow Improvements

  • Terraform Cloud Agents

  • Terraform Enterprise Admin

  • Other Docs

  • Intro to Terraform
  • Configuration Language
  • Terraform CLI
  • Terraform Cloud
  • Terraform Enterprise
  • Provider Use
  • Plugin Development
  • Registry Publishing
  • Integration Program
  • Terraform Tools
  • CDK for Terraform
  • Glossary
Type '/' to Search

»Organizations API

The Organizations API is used to list, show, create, update, and destroy organizations.

»List Organizations

GET /organizations

StatusResponseReason
200JSON API document (type: "organizations")The request was successful
404JSON API error objectOrganization not found or user unauthorized to perform action

»Query Parameters

This endpoint supports pagination with standard URL query parameters. Remember to percent-encode [ as %5B and ] as %5D if your tooling doesn't automatically encode URLs.

Currently, this endpoint returns a full, unpaginated list of organizations (without pagination metadata) if both of the pagination query parameters are omitted. To avoid inconsistent behavior, we recommend always supplying pagination parameters when building against this API.

ParameterDescription
page[number]Optional. Defaults to the first page, if omitted when page[size] is provided.
page[size]Optional. Defaults to 20 organizations per page, if omitted when page[number] is provided.

»Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request GET \
  https://app.terraform.io/api/v2/organizations\?page\[number\]\=1\&page\[size\]\=20
curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request GET \
  https://app.terraform.io/api/v2/organizations\?page\[number\]\=1\&page\[size\]\=20

»Sample Response

{
  "data": [
    {
      "id": "hashicorp",
      "type": "organizations",
      "attributes": {
        "external-id": "org-Hysjx5eUviuKVCJY",
        "created-at": "2021-08-24T23:10:04.675Z",
        "email": "hashicorp@example.com",
        "session-timeout": null,
        "session-remember": null,
        "collaborator-auth-policy": "password",
        "plan-expired": false,
        "plan-expires-at": null,
        "plan-is-trial": false,
        "plan-is-enterprise": false,
        "plan-identifier": "developer",
        "cost-estimation-enabled": true,
        "send-passing-statuses-for-untriggered-speculative-plans": true,
        "name": "hashicorp",
        "permissions": {
          "can-update": true,
          "can-destroy": true,
          "can-access-via-teams": true,
          "can-create-module": true,
          "can-create-team": true,
          "can-create-workspace": true,
          "can-manage-users": true,
          "can-manage-subscription": true,
          "can-manage-sso": true,
          "can-update-oauth": true,
          "can-update-sentinel": true,
          "can-update-ssh-keys": true,
          "can-update-api-token": true,
          "can-traverse": true,
          "can-start-trial": true,
          "can-update-agent-pools": true,
          "can-manage-tags": true,
          "can-manage-varsets": true,
          "can-read-varsets": true,
          "can-manage-public-providers": true,
          "can-create-provider": true,
          "can-manage-public-modules": true,
          "can-manage-custom-providers": false,
          "can-manage-run-tasks": false,
          "can-read-run-tasks": false
        },
        "fair-run-queuing-enabled": true,
        "saml-enabled": false,
        "owners-team-saml-role-id": null,
        "two-factor-conformant": false
      },
      "relationships": {
        "oauth-tokens": {
          "links": {
            "related": "/api/v2/organizations/hashicorp/oauth-tokens"
          }
        },
        "authentication-token": {
          "links": {
            "related": "/api/v2/organizations/hashicorp/authentication-token"
          }
        },
        "entitlement-set": {
          "data": {
            "id": "org-Hysjx5eUviuKVCJY",
            "type": "entitlement-sets"
          },
          "links": {
            "related": "/api/v2/organizations/hashicorp/entitlement-set"
          }
        },
        "subscription": {
          "links": {
            "related": "/api/v2/organizations/hashicorp/subscription"
          }
        }
      },
      "links": {
        "self": "/api/v2/organizations/hashicorp"
      }
    },
    {
      "id": "hashicorp-two",
      "type": "organizations",
      "attributes": {
        "external-id": "org-iJ5tr4WgB4WpA1hD",
        "created-at": "2022-01-04T18:57:16.036Z",
        "email": "hashicorp@example.com",
        "session-timeout": null,
        "session-remember": null,
        "collaborator-auth-policy": "password",
        "plan-expired": false,
        "plan-expires-at": null,
        "plan-is-trial": false,
        "plan-is-enterprise": false,
        "plan-identifier": "free",
        "cost-estimation-enabled": false,
        "send-passing-statuses-for-untriggered-speculative-plans": false,
        "name": "hashicorp-two",
        "permissions": {
          "can-update": true,
          "can-destroy": true,
          "can-access-via-teams": true,
          "can-create-module": true,
          "can-create-team": false,
          "can-create-workspace": true,
          "can-manage-users": true,
          "can-manage-subscription": true,
          "can-manage-sso": false,
          "can-update-oauth": true,
          "can-update-sentinel": false,
          "can-update-ssh-keys": true,
          "can-update-api-token": true,
          "can-traverse": true,
          "can-start-trial": true,
          "can-update-agent-pools": false,
          "can-manage-tags": true,
          "can-manage-varsets": true,
          "can-read-varsets": true,
          "can-manage-public-providers": true,
          "can-create-provider": true,
          "can-manage-public-modules": true,
          "can-manage-custom-providers": false,
          "can-manage-run-tasks": false,
          "can-read-run-tasks": false
        },
        "fair-run-queuing-enabled": true,
        "saml-enabled": false,
        "owners-team-saml-role-id": null,
        "two-factor-conformant": false
      },
      "relationships": {
        "oauth-tokens": {
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/oauth-tokens"
          }
        },
        "authentication-token": {
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/authentication-token"
          }
        },
        "entitlement-set": {
          "data": {
            "id": "org-iJ5tr4WgB4WpA1hD",
            "type": "entitlement-sets"
          },
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/entitlement-set"
          }
        },
        "subscription": {
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/subscription"
          }
        }
      },
      "links": {
        "self": "/api/v2/organizations/hashicorp-two"
      }
    }
  ],
  "links": {
    "self": "https://tfe-zone-b0c8608c.ngrok.io/api/v2/organizations?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "first": "https://tfe-zone-b0c8608c.ngrok.io/api/v2/organizations?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "prev": null,
    "next": null,
    "last": "https://tfe-zone-b0c8608c.ngrok.io/api/v2/organizations?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  },
  "meta": {
    "pagination": {
      "current-page": 1,
      "page-size": 20,
      "prev-page": null,
      "next-page": null,
      "total-pages": 1,
      "total-count": 2
    }
  }
}
{
  "data": [
    {
      "id": "hashicorp",
      "type": "organizations",
      "attributes": {
        "external-id": "org-Hysjx5eUviuKVCJY",
        "created-at": "2021-08-24T23:10:04.675Z",
        "email": "hashicorp@example.com",
        "session-timeout": null,
        "session-remember": null,
        "collaborator-auth-policy": "password",
        "plan-expired": false,
        "plan-expires-at": null,
        "plan-is-trial": false,
        "plan-is-enterprise": false,
        "plan-identifier": "developer",
        "cost-estimation-enabled": true,
        "send-passing-statuses-for-untriggered-speculative-plans": true,
        "name": "hashicorp",
        "permissions": {
          "can-update": true,
          "can-destroy": true,
          "can-access-via-teams": true,
          "can-create-module": true,
          "can-create-team": true,
          "can-create-workspace": true,
          "can-manage-users": true,
          "can-manage-subscription": true,
          "can-manage-sso": true,
          "can-update-oauth": true,
          "can-update-sentinel": true,
          "can-update-ssh-keys": true,
          "can-update-api-token": true,
          "can-traverse": true,
          "can-start-trial": true,
          "can-update-agent-pools": true,
          "can-manage-tags": true,
          "can-manage-varsets": true,
          "can-read-varsets": true,
          "can-manage-public-providers": true,
          "can-create-provider": true,
          "can-manage-public-modules": true,
          "can-manage-custom-providers": false,
          "can-manage-run-tasks": false,
          "can-read-run-tasks": false
        },
        "fair-run-queuing-enabled": true,
        "saml-enabled": false,
        "owners-team-saml-role-id": null,
        "two-factor-conformant": false
      },
      "relationships": {
        "oauth-tokens": {
          "links": {
            "related": "/api/v2/organizations/hashicorp/oauth-tokens"
          }
        },
        "authentication-token": {
          "links": {
            "related": "/api/v2/organizations/hashicorp/authentication-token"
          }
        },
        "entitlement-set": {
          "data": {
            "id": "org-Hysjx5eUviuKVCJY",
            "type": "entitlement-sets"
          },
          "links": {
            "related": "/api/v2/organizations/hashicorp/entitlement-set"
          }
        },
        "subscription": {
          "links": {
            "related": "/api/v2/organizations/hashicorp/subscription"
          }
        }
      },
      "links": {
        "self": "/api/v2/organizations/hashicorp"
      }
    },
    {
      "id": "hashicorp-two",
      "type": "organizations",
      "attributes": {
        "external-id": "org-iJ5tr4WgB4WpA1hD",
        "created-at": "2022-01-04T18:57:16.036Z",
        "email": "hashicorp@example.com",
        "session-timeout": null,
        "session-remember": null,
        "collaborator-auth-policy": "password",
        "plan-expired": false,
        "plan-expires-at": null,
        "plan-is-trial": false,
        "plan-is-enterprise": false,
        "plan-identifier": "free",
        "cost-estimation-enabled": false,
        "send-passing-statuses-for-untriggered-speculative-plans": false,
        "name": "hashicorp-two",
        "permissions": {
          "can-update": true,
          "can-destroy": true,
          "can-access-via-teams": true,
          "can-create-module": true,
          "can-create-team": false,
          "can-create-workspace": true,
          "can-manage-users": true,
          "can-manage-subscription": true,
          "can-manage-sso": false,
          "can-update-oauth": true,
          "can-update-sentinel": false,
          "can-update-ssh-keys": true,
          "can-update-api-token": true,
          "can-traverse": true,
          "can-start-trial": true,
          "can-update-agent-pools": false,
          "can-manage-tags": true,
          "can-manage-varsets": true,
          "can-read-varsets": true,
          "can-manage-public-providers": true,
          "can-create-provider": true,
          "can-manage-public-modules": true,
          "can-manage-custom-providers": false,
          "can-manage-run-tasks": false,
          "can-read-run-tasks": false
        },
        "fair-run-queuing-enabled": true,
        "saml-enabled": false,
        "owners-team-saml-role-id": null,
        "two-factor-conformant": false
      },
      "relationships": {
        "oauth-tokens": {
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/oauth-tokens"
          }
        },
        "authentication-token": {
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/authentication-token"
          }
        },
        "entitlement-set": {
          "data": {
            "id": "org-iJ5tr4WgB4WpA1hD",
            "type": "entitlement-sets"
          },
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/entitlement-set"
          }
        },
        "subscription": {
          "links": {
            "related": "/api/v2/organizations/hashicorp-two/subscription"
          }
        }
      },
      "links": {
        "self": "/api/v2/organizations/hashicorp-two"
      }
    }
  ],
  "links": {
    "self": "https://tfe-zone-b0c8608c.ngrok.io/api/v2/organizations?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "first": "https://tfe-zone-b0c8608c.ngrok.io/api/v2/organizations?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "prev": null,
    "next": null,
    "last": "https://tfe-zone-b0c8608c.ngrok.io/api/v2/organizations?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  },
  "meta": {
    "pagination": {
      "current-page": 1,
      "page-size": 20,
      "prev-page": null,
      "next-page": null,
      "total-pages": 1,
      "total-count": 2
    }
  }
}

»Show an Organization

GET /organizations/:organization_name

ParameterDescription
:organization_nameThe name of the organization to show
StatusResponseReason
200JSON API document (type: "organizations")The request was successful
404JSON API error objectOrganization not found or user unauthorized to perform action

»Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request GET \
  https://app.terraform.io/api/v2/organizations/hashicorp
curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request GET \
  https://app.terraform.io/api/v2/organizations/hashicorp

»Sample Response

{
  "data": {
    "id": "hashicorp",
    "type": "organizations",
    "attributes": {
      "external-id": "org-WV6DfwfxxXvLfvfs",
      "created-at": "2020-03-26T22:13:38.456Z",
      "email": "user@example.com",
      "session-timeout": null,
      "session-remember": null,
      "collaborator-auth-policy": "password",
      "plan-expired": false,
      "plan-expires-at": null,
      "plan-is-trial": false,
      "plan-is-enterprise": false,
      "cost-estimation-enabled": false,
      "send-passing-statuses-for-untriggered-speculative-plans": false,
      "name": "hashicorp",
      "permissions": {
        "can-update": true,
        "can-destroy": true,
        "can-access-via-teams": true,
        "can-create-module": true,
        "can-create-team": false,
        "can-create-workspace": true,
        "can-manage-users": true,
        "can-manage-subscription": true,
        "can-manage-sso": false,
        "can-update-oauth": true,
        "can-update-sentinel": false,
        "can-update-ssh-keys": true,
        "can-update-api-token": true,
        "can-traverse": true,
        "can-start-trial": true,
        "can-update-agent-pools": false,
        "can-manage-tags": true,
        "can-manage-public-modules": true,
        "can-manage-public-providers": false,
        "can-manage-run-tasks": false,
        "can-read-run-tasks": false,
        "can-create-provider": false
      },
      "fair-run-queuing-enabled": true,
      "saml-enabled": false,
      "owners-team-saml-role-id": null,
      "two-factor-conformant": false
    },
    "relationships": {
      "oauth-tokens": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/oauth-tokens"
        }
      },
      "authentication-token": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/authentication-token"
        }
      },
      "entitlement-set": {
        "data": {
          "id": "org-WV6DfwfxxXvLfvfs",
          "type": "entitlement-sets"
        },
        "links": {
          "related": "/api/v2/organizations/hashicorp/entitlement-set"
        }
      },
      "subscription": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/subscription"
        }
      }
    },
    "links": {
      "self": "/api/v2/organizations/hashicorp"
    }
  }
}
{
  "data": {
    "id": "hashicorp",
    "type": "organizations",
    "attributes": {
      "external-id": "org-WV6DfwfxxXvLfvfs",
      "created-at": "2020-03-26T22:13:38.456Z",
      "email": "user@example.com",
      "session-timeout": null,
      "session-remember": null,
      "collaborator-auth-policy": "password",
      "plan-expired": false,
      "plan-expires-at": null,
      "plan-is-trial": false,
      "plan-is-enterprise": false,
      "cost-estimation-enabled": false,
      "send-passing-statuses-for-untriggered-speculative-plans": false,
      "name": "hashicorp",
      "permissions": {
        "can-update": true,
        "can-destroy": true,
        "can-access-via-teams": true,
        "can-create-module": true,
        "can-create-team": false,
        "can-create-workspace": true,
        "can-manage-users": true,
        "can-manage-subscription": true,
        "can-manage-sso": false,
        "can-update-oauth": true,
        "can-update-sentinel": false,
        "can-update-ssh-keys": true,
        "can-update-api-token": true,
        "can-traverse": true,
        "can-start-trial": true,
        "can-update-agent-pools": false,
        "can-manage-tags": true,
        "can-manage-public-modules": true,
        "can-manage-public-providers": false,
        "can-manage-run-tasks": false,
        "can-read-run-tasks": false,
        "can-create-provider": false
      },
      "fair-run-queuing-enabled": true,
      "saml-enabled": false,
      "owners-team-saml-role-id": null,
      "two-factor-conformant": false
    },
    "relationships": {
      "oauth-tokens": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/oauth-tokens"
        }
      },
      "authentication-token": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/authentication-token"
        }
      },
      "entitlement-set": {
        "data": {
          "id": "org-WV6DfwfxxXvLfvfs",
          "type": "entitlement-sets"
        },
        "links": {
          "related": "/api/v2/organizations/hashicorp/entitlement-set"
        }
      },
      "subscription": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/subscription"
        }
      }
    },
    "links": {
      "self": "/api/v2/organizations/hashicorp"
    }
  }
}

»Create an Organization

POST /organizations

StatusResponseReason
201JSON API document (type: "organizations")The organization was successfully created
404JSON API error objectOrganization not found or user unauthorized to perform action
422JSON API error objectMalformed request body (missing attributes, wrong types, etc.)

»Request Body

This POST endpoint requires a JSON object with the following properties as a request payload.

Properties without a default value are required.

Key pathTypeDefaultDescription
data.typestringMust be "organizations"
data.attributes.namestringName of the organization
data.attributes.emailstringAdmin email address
data.attributes.session-timeoutinteger20160Session timeout after inactivity (minutes)
data.attributes.session-rememberinteger20160Session expiration (minutes)
data.attributes.collaborator-auth-policystringpasswordAuthentication policy (password or two_factor_mandatory)
data.attributes.cost-estimation-enabledbooleantrueWhether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization that does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration.
data.attributes.send-passing-statuses-for-untriggered-speculative-plansbooleanfalseWhether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting is always false and cannot be changed but is also available in Site Administration.
data.attributes.owners-team-saml-role-idstring(nothing)Optional. SAML only The name of the "owners" team

»Sample Payload

{
  "data": {
    "type": "organizations",
    "attributes": {
      "name": "hashicorp",
      "email": "user@example.com"
    }
  }
}
{
  "data": {
    "type": "organizations",
    "attributes": {
      "name": "hashicorp",
      "email": "user@example.com"
    }
  }
}

»Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request POST \
  --data @payload.json \
  https://app.terraform.io/api/v2/organizations
curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request POST \
  --data @payload.json \
  https://app.terraform.io/api/v2/organizations

»Sample Response

{
  "data": {
    "id": "hashicorp",
    "type": "organizations",
    "attributes": {
      "external-id": "org-Bzyc2JuegvVLAibn",
      "created-at": "2021-08-30T18:09:57.561Z",
      "email": "user@example.com",
      "session-timeout": null,
      "session-remember": null,
      "collaborator-auth-policy": "password",
      "plan-expired": false,
      "plan-expires-at": null,
      "plan-is-trial": false,
      "plan-is-enterprise": false,
      "cost-estimation-enabled": false,
      "send-passing-statuses-for-untriggered-speculative-plans": false,
      "name": "hashicorp",
      "permissions": {
        "can-update": true,
        "can-destroy": true,
        "can-access-via-teams": true,
        "can-create-module": true,
        "can-create-team": false,
        "can-create-workspace": true,
        "can-manage-users": true,
        "can-manage-subscription": true,
        "can-manage-sso": false,
        "can-update-oauth": true,
        "can-update-sentinel": false,
        "can-update-ssh-keys": true,
        "can-update-api-token": true,
        "can-traverse": true,
        "can-start-trial": true,
        "can-update-agent-pools": false,
        "can-manage-tags": true,
        "can-manage-public-modules": true,
        "can-manage-public-providers": false,
        "can-manage-run-tasks": false,
        "can-read-run-tasks": false,
        "can-create-provider": false
      },
      "fair-run-queuing-enabled": true,
      "saml-enabled": false,
      "owners-team-saml-role-id": null,
      "two-factor-conformant": false
    },
    "relationships": {
      "oauth-tokens": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/oauth-tokens"
        }
      },
      "authentication-token": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/authentication-token"
        }
      },
      "entitlement-set": {
        "data": {
          "id": "org-Bzyc2JuegvVLAibn",
          "type": "entitlement-sets"
        },
        "links": {
          "related": "/api/v2/organizations/hashicorp/entitlement-set"
        }
      },
      "subscription": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/subscription"
        }
      }
    },
    "links": {
      "self": "/api/v2/organizations/hashicorp"
    }
  },
  "included": [
    {
      "id": "org-Bzyc2JuegvVLAibn",
      "type": "entitlement-sets",
      "attributes": {
        "cost-estimation": false,
        "configuration-designer": true,
        "operations": true,
        "private-module-registry": true,
        "sentinel": false,
        "run-tasks": false,
        "state-storage": true,
        "teams": false,
        "vcs-integrations": true,
        "usage-reporting": false,
        "user-limit": 5,
        "self-serve-billing": true,
        "audit-logging": false,
        "agents": false,
        "sso": false
      },
      "links": {
        "self": "/api/v2/entitlement-sets/org-Bzyc2JuegvVLAibn"
      }
    }
  ]
}
{
  "data": {
    "id": "hashicorp",
    "type": "organizations",
    "attributes": {
      "external-id": "org-Bzyc2JuegvVLAibn",
      "created-at": "2021-08-30T18:09:57.561Z",
      "email": "user@example.com",
      "session-timeout": null,
      "session-remember": null,
      "collaborator-auth-policy": "password",
      "plan-expired": false,
      "plan-expires-at": null,
      "plan-is-trial": false,
      "plan-is-enterprise": false,
      "cost-estimation-enabled": false,
      "send-passing-statuses-for-untriggered-speculative-plans": false,
      "name": "hashicorp",
      "permissions": {
        "can-update": true,
        "can-destroy": true,
        "can-access-via-teams": true,
        "can-create-module": true,
        "can-create-team": false,
        "can-create-workspace": true,
        "can-manage-users": true,
        "can-manage-subscription": true,
        "can-manage-sso": false,
        "can-update-oauth": true,
        "can-update-sentinel": false,
        "can-update-ssh-keys": true,
        "can-update-api-token": true,
        "can-traverse": true,
        "can-start-trial": true,
        "can-update-agent-pools": false,
        "can-manage-tags": true,
        "can-manage-public-modules": true,
        "can-manage-public-providers": false,
        "can-manage-run-tasks": false,
        "can-read-run-tasks": false,
        "can-create-provider": false
      },
      "fair-run-queuing-enabled": true,
      "saml-enabled": false,
      "owners-team-saml-role-id": null,
      "two-factor-conformant": false
    },
    "relationships": {
      "oauth-tokens": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/oauth-tokens"
        }
      },
      "authentication-token": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/authentication-token"
        }
      },
      "entitlement-set": {
        "data": {
          "id": "org-Bzyc2JuegvVLAibn",
          "type": "entitlement-sets"
        },
        "links": {
          "related": "/api/v2/organizations/hashicorp/entitlement-set"
        }
      },
      "subscription": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/subscription"
        }
      }
    },
    "links": {
      "self": "/api/v2/organizations/hashicorp"
    }
  },
  "included": [
    {
      "id": "org-Bzyc2JuegvVLAibn",
      "type": "entitlement-sets",
      "attributes": {
        "cost-estimation": false,
        "configuration-designer": true,
        "operations": true,
        "private-module-registry": true,
        "sentinel": false,
        "run-tasks": false,
        "state-storage": true,
        "teams": false,
        "vcs-integrations": true,
        "usage-reporting": false,
        "user-limit": 5,
        "self-serve-billing": true,
        "audit-logging": false,
        "agents": false,
        "sso": false
      },
      "links": {
        "self": "/api/v2/entitlement-sets/org-Bzyc2JuegvVLAibn"
      }
    }
  ]
}

»Update an Organization

PATCH /organizations/:organization_name

ParameterDescription
:organization_nameThe name of the organization to update
StatusResponseReason
200JSON API document (type: "organizations")The organization was successfully updated
404JSON API error objectOrganization not found or user unauthorized to perform action
422JSON API error objectMalformed request body (missing attributes, wrong types, etc.)

»Request Body

This PATCH endpoint requires a JSON object with the following properties as a request payload.

Key pathTypeDefaultDescription
data.typestringMust be "organizations"
data.attributes.namestringName of the organization
data.attributes.emailstringAdmin email address
data.attributes.session-timeoutinteger20160Session timeout after inactivity (minutes)
data.attributes.session-rememberinteger20160Session expiration (minutes)
data.attributes.collaborator-auth-policystringpasswordAuthentication policy (password or two_factor_mandatory)
data.attributes.cost-estimation-enabledbooleantrueWhether or not the cost estimation feature is enabled for all workspaces in the organization. Defaults to true. In a Terraform Cloud organization that does not have Teams & Governance features, this value is always false and cannot be changed. In Terraform Enterprise, Cost Estimation must also be enabled in Site Administration.
data.attributes.send-passing-statuses-for-untriggered-speculative-plansbooleanfalseWhether or not to send VCS status updates for untriggered speculative plans. This can be useful if large numbers of untriggered workspaces are exhausting request limits for connected version control service providers like GitHub. Defaults to false. In Terraform Enterprise, this setting is always false and cannot be changed but is also available in Site Administration.
data.attributes.owners-team-saml-role-idstring(nothing)Optional. SAML only The name of the "owners" team

»Sample Payload

{
  "data": {
    "type": "organizations",
    "attributes": {
      "email": "admin@example.com"
    }
  }
}
{
  "data": {
    "type": "organizations",
    "attributes": {
      "email": "admin@example.com"
    }
  }
}

»Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request PATCH \
  --data @payload.json \
  https://app.terraform.io/api/v2/organizations/hashicorp
curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request PATCH \
  --data @payload.json \
  https://app.terraform.io/api/v2/organizations/hashicorp

»Sample Response

{
  "data": {
    "id": "hashicorp",
    "type": "organizations",
    "attributes": {
      "external-id": "org-Bzyc2JuegvVLAibn",
      "created-at": "2021-08-30T18:09:57.561Z",
      "email": "admin@example.com",
      "session-timeout": null,
      "session-remember": null,
      "collaborator-auth-policy": "password",
      "plan-expired": false,
      "plan-expires-at": null,
      "plan-is-trial": false,
      "plan-is-enterprise": false,
      "cost-estimation-enabled": false,
      "send-passing-statuses-for-untriggered-speculative-plans": false,
      "name": "hashicorp",
      "permissions": {
        "can-update": true,
        "can-destroy": true,
        "can-access-via-teams": true,
        "can-create-module": true,
        "can-create-team": false,
        "can-create-workspace": true,
        "can-manage-users": true,
        "can-manage-subscription": true,
        "can-manage-sso": false,
        "can-update-oauth": true,
        "can-update-sentinel": false,
        "can-update-ssh-keys": true,
        "can-update-api-token": true,
        "can-traverse": true,
        "can-start-trial": true,
        "can-update-agent-pools": false,
        "can-manage-tags": true,
        "can-manage-public-modules": true,
        "can-manage-public-providers": false,
        "can-manage-run-tasks": false,
        "can-read-run-tasks": false,
        "can-create-provider": false
      },
      "fair-run-queuing-enabled": true,
      "saml-enabled": false,
      "owners-team-saml-role-id": null,
      "two-factor-conformant": false
    },
    "relationships": {
      "oauth-tokens": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/oauth-tokens"
        }
      },
      "authentication-token": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/authentication-token"
        }
      },
      "entitlement-set": {
        "data": {
          "id": "org-Bzyc2JuegvVLAibn",
          "type": "entitlement-sets"
        },
        "links": {
          "related": "/api/v2/organizations/hashicorp/entitlement-set"
        }
      },
      "subscription": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/subscription"
        }
      }
    },
    "links": {
      "self": "/api/v2/organizations/hashicorp"
    }
  }
}
{
  "data": {
    "id": "hashicorp",
    "type": "organizations",
    "attributes": {
      "external-id": "org-Bzyc2JuegvVLAibn",
      "created-at": "2021-08-30T18:09:57.561Z",
      "email": "admin@example.com",
      "session-timeout": null,
      "session-remember": null,
      "collaborator-auth-policy": "password",
      "plan-expired": false,
      "plan-expires-at": null,
      "plan-is-trial": false,
      "plan-is-enterprise": false,
      "cost-estimation-enabled": false,
      "send-passing-statuses-for-untriggered-speculative-plans": false,
      "name": "hashicorp",
      "permissions": {
        "can-update": true,
        "can-destroy": true,
        "can-access-via-teams": true,
        "can-create-module": true,
        "can-create-team": false,
        "can-create-workspace": true,
        "can-manage-users": true,
        "can-manage-subscription": true,
        "can-manage-sso": false,
        "can-update-oauth": true,
        "can-update-sentinel": false,
        "can-update-ssh-keys": true,
        "can-update-api-token": true,
        "can-traverse": true,
        "can-start-trial": true,
        "can-update-agent-pools": false,
        "can-manage-tags": true,
        "can-manage-public-modules": true,
        "can-manage-public-providers": false,
        "can-manage-run-tasks": false,
        "can-read-run-tasks": false,
        "can-create-provider": false
      },
      "fair-run-queuing-enabled": true,
      "saml-enabled": false,
      "owners-team-saml-role-id": null,
      "two-factor-conformant": false
    },
    "relationships": {
      "oauth-tokens": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/oauth-tokens"
        }
      },
      "authentication-token": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/authentication-token"
        }
      },
      "entitlement-set": {
        "data": {
          "id": "org-Bzyc2JuegvVLAibn",
          "type": "entitlement-sets"
        },
        "links": {
          "related": "/api/v2/organizations/hashicorp/entitlement-set"
        }
      },
      "subscription": {
        "links": {
          "related": "/api/v2/organizations/hashicorp/subscription"
        }
      }
    },
    "links": {
      "self": "/api/v2/organizations/hashicorp"
    }
  }
}

»Destroy an Organization

DELETE /organizations/:organization_name

ParameterDescription
:organization_nameThe name of the organization to destroy
StatusResponseReason
204The organization was successfully destroyed
404JSON API error objectOrganization not found or user unauthorized to perform action

»Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request DELETE \
  https://app.terraform.io/api/v2/organizations/hashicorp
curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  --request DELETE \
  https://app.terraform.io/api/v2/organizations/hashicorp

»Sample Response

The response body will be empty if successful.

»Show the Entitlement Set

This endpoint shows the entitlements for an organization.

GET /organizations/:organization_name/entitlement-set

ParameterDescription
:organization_nameThe name of the organization's entitlement set to view
StatusResponseReason
200JSON API document (type: "entitlement-sets")The request was successful
404JSON API error objectOrganization not found or user unauthorized to perform action

»Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  https://app.terraform.io/api/v2/organizations/hashicorp/entitlement-set
curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  https://app.terraform.io/api/v2/organizations/hashicorp/entitlement-set

»Sample Response

{
  "data": {
    "id": "org-Bzyc2JuegvVLAibn",
    "type": "entitlement-sets",
    "attributes": {
      "cost-estimation": false,
      "configuration-designer": true,
      "operations": true,
      "private-module-registry": true,
      "sentinel": false,
      "run-tasks": false,
      "state-storage": true,
      "teams": false,
      "vcs-integrations": true,
      "usage-reporting": false,
      "user-limit": 5,
      "self-serve-billing": true,
      "audit-logging": false,
      "agents": false,
      "sso": false
    },
    "links": {
      "self": "/api/v2/entitlement-sets/org-Bzyc2JuegvVLAibn"
    }
  }
}
{
  "data": {
    "id": "org-Bzyc2JuegvVLAibn",
    "type": "entitlement-sets",
    "attributes": {
      "cost-estimation": false,
      "configuration-designer": true,
      "operations": true,
      "private-module-registry": true,
      "sentinel": false,
      "run-tasks": false,
      "state-storage": true,
      "teams": false,
      "vcs-integrations": true,
      "usage-reporting": false,
      "user-limit": 5,
      "self-serve-billing": true,
      "audit-logging": false,
      "agents": false,
      "sso": false
    },
    "links": {
      "self": "/api/v2/entitlement-sets/org-Bzyc2JuegvVLAibn"
    }
  }
}

»Show Module Producers

Note: This endpoint is available in Terraform Enterprise v202103-1 or later. It is not available on Terraform Cloud.

This endpoint shows organizations that are configured to share modules with an organization through Module Sharing.

GET /organizations/:organization_name/relationships/module-producers

ParameterDescription
:organization_nameThe name of the organization's module producers to view
StatusResponseReason
200JSON API document (type: "organizations")The request was successful
404JSON API error objectOrganization not found or user unauthorized to perform action

»Query Parameters

This endpoint supports pagination with standard URL query parameters. Remember to percent-encode [ as %5B and ] as %5D if your tooling doesn't automatically encode URLs.

ParameterDescription
page[number]Optional. If omitted, the endpoint will return the first page.
page[size]Optional. If omitted, the endpoint will return 20 module producers per page.

»Sample Request

curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers
curl \
  --header "Authorization: Bearer $TOKEN" \
  --header "Content-Type: application/vnd.api+json" \
  https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers

»Sample Response

{
  "data": [
    {
      "id": "hc-nomad",
      "type": "organizations",
      "attributes": {
        "name": "hc-nomad",
        "external-id": "org-ArQSQMAkFQsSUZjB"
      },
      "links": {
        "self": "/api/v2/organizations/hc-nomad"
      }
    }
  ],
  "links": {
    "self": "https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "first": "https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "prev": null,
    "next": null,
    "last": "https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  },
  "meta": {
    "pagination": {
      "current-page": 1,
      "prev-page": null,
      "next-page": null,
      "total-pages": 1,
      "total-count": 1
    }
  }
}
{
  "data": [
    {
      "id": "hc-nomad",
      "type": "organizations",
      "attributes": {
        "name": "hc-nomad",
        "external-id": "org-ArQSQMAkFQsSUZjB"
      },
      "links": {
        "self": "/api/v2/organizations/hc-nomad"
      }
    }
  ],
  "links": {
    "self": "https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "first": "https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers?page%5Bnumber%5D=1&page%5Bsize%5D=20",
    "prev": null,
    "next": null,
    "last": "https://tfe.example.com/api/v2/organizations/hashicorp/relationships/module-producers?page%5Bnumber%5D=1&page%5Bsize%5D=20"
  },
  "meta": {
    "pagination": {
      "current-page": 1,
      "prev-page": null,
      "next-page": null,
      "total-pages": 1,
      "total-count": 1
    }
  }
}

»Available Related Resources

The GET endpoints above can optionally return related resources, if requested with the include query parameter. The following resource types are available:

Resource NameDescription
entitlement_setThe entitlement set that determines which Terraform Cloud features the organization can use.

»Relationships

The following relationships may be present in various responses.

Resource NameDescription
module-producersOther organizations that are configured to share modules with the organization. Terraform Enterprise v202103-1 or later only.
oauth-tokensOAuth tokens associated with VCS configurations for the organization.
authentication-tokenThe API token for an organization.
entitlement-setThe entitlement set that determines which Terraform Cloud features the organization can use.
subscriptionThe current subscription for an organization.
github logoEdit this page
  • Overview
  • Docs
  • Extend
  • Privacy
  • Security
  • Press Kit
  • Consent Manager