---
updatedAt: 2026-04-21T08:54:41.000Z
agentTools:
  projectIndex: https://docs.scalr.io/llms.txt
---

# Unlock an Environment

This endpoint unlocks an environment.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "Environment": {
        "description": "Environments are collections of related workspaces that correspond to functional areas, SDLC stages,\nprojects or any grouping that is required.\n\nAn account can have multiple environments.\n\nWorkspaces within an environment are where Terraform configurations are run to deploy infrastructure,\nand where state files are stored.\n\nAn Environment can have set of policy groups assigned that are applied to all workspaces in the environment.\nThe Environment can also have variables, credentials, registry modules, and VCS providers\nthat are available to every workspace.",
        "properties": {
          "attributes": {
            "properties": {
              "created-at": {
                "description": "Date/Time the environment was created.",
                "format": "date-time",
                "readOnly": true,
                "type": "string"
              },
              "created-by-email": {
                "nullable": true,
                "readOnly": true,
                "type": "string"
              },
              "favorite": {
                "description": "Indicates whether the environment is marked as favorite by the current user.",
                "readOnly": true,
                "type": "boolean"
              },
              "is-federated-to-account": {
                "description": "Allow all current and future environments to have access to this environment.",
                "type": "boolean"
              },
              "lock-reason": {
                "description": "The reason (if any) that the environment has been locked.",
                "nullable": true,
                "readOnly": true,
                "type": "string"
              },
              "locked": {
                "description": "Whether the environment is locked. If locked runs won't be queued to execute.",
                "readOnly": true,
                "type": "boolean"
              },
              "mask-sensitive-output": {
                "default": true,
                "description": "Enable masking of the sensitive console output.",
                "type": "boolean"
              },
              "name": {
                "description": "The name of the environment.",
                "maxLength": 255,
                "type": "string"
              },
              "permissions": {
                "readOnly": true,
                "type": "object"
              },
              "remote-backend": {
                "default": true,
                "description": "Manages if Scalr exports the remote backend configuration and state storage for your infrastructure management. Disabling this feature will also prevent the ability to perform state locking, which ensures that concurrent operations do not conflict. Additionally, it will disable the capability to initiate CLI-driven runs through Scalr.",
                "type": "boolean"
              },
              "remote-backend-overridable": {
                "default": true,
                "description": "Indicates if the remote backend configuration can be overridden on the workspace level.",
                "type": "boolean"
              },
              "status": {
                "readOnly": true,
                "type": "string"
              },
              "updated-at": {
                "description": "Date/Time when the environment was last updated.",
                "format": "date-time",
                "nullable": true,
                "readOnly": true,
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object"
          },
          "id": {
            "readOnly": true,
            "type": "string"
          },
          "links": {
            "properties": {
              "self": {
                "readOnly": true,
                "type": "string"
              }
            },
            "readOnly": true,
            "type": "object"
          },
          "relationships": {
            "properties": {
              "account": {
                "description": "The account that owns this environment.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "accounts",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "created-by": {
                "description": "The user that created the environment.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "users",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "default-provider-configurations": {
                "description": "Provider configurations used in the environment workspaces by default.",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "provider-configurations",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "default-workspace-agent-pool": {
                "description": "Default agent pool that will be set for the entire environment. It will be used by a workspace if no other pool is explicitly linked.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "agent-pools",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "drift-detection-schedules": {
                "description": "The drift detection schedules for this environment",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "drift-detection-schedule",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "locked-by": {
                "description": "The user that locked this environment.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "users",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "policy-groups": {
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "policy-groups",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "provider-configurations": {
                "description": "Provider configurations available for this environment.",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "provider-configurations",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "storage-profile": {
                "description": "The storage profile for this environment. If not set, the account's default storage profile will be used.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "storage-profiles",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "tags": {
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "tags",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "updated-by": {
                "description": "The last user that updated this environment.",
                "properties": {
                  "data": {
                    "nullable": true,
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "users",
                          ""
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "id"
                    ],
                    "type": "object"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "type": {
            "enum": [
              "environments"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "attributes"
        ],
        "type": "object"
      },
      "EnvironmentDocument": {
        "description": "JSON:API Document.\n\nsee: https://jsonapi.org/format/#document-structure",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Environment"
          },
          "included": {
            "items": {
              "type": "object"
            },
            "readOnly": true,
            "type": "array"
          },
          "meta": {
            "readOnly": true,
            "type": "object"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "API-Key": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Scalr IACP API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Scalr IACP API",
    "version": "unversioned"
  },
  "openapi": "3.0.0",
  "paths": {
    "/environments/{environment}/actions/unlock": {
      "post": {
        "description": "This endpoint unlocks an environment.",
        "operationId": "unlock_environment",
        "parameters": [
          {
            "description": "The environment ID to unlock.",
            "in": "path",
            "name": "environment",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentDocument"
                }
              }
            },
            "description": "Successfully unlocked the environment."
          },
          "404": {
            "description": "Environment not found, or user unauthorized to perform action."
          },
          "409": {
            "description": "Environment is not locked."
          },
          "4XX": {
            "description": "Client error."
          },
          "5XX": {
            "description": "Server error."
          }
        },
        "summary": "Unlock an Environment",
        "tags": [
          "environments"
        ],
        "x-resource": "Environment",
        "x-service": "tf-api"
      }
    }
  },
  "security": [
    {
      "API-Key": []
    }
  ],
  "servers": [
    {
      "url": "https://{Domain}/api/iacp/v3",
      "variables": {
        "Domain": {
          "default": "example.scalr.io",
          "description": "Domain where Scalr is hosted"
        }
      }
    }
  ]
}
```

# Sibling pages

* [List Environments](https://docs.scalr.io/scalr/reference/list_environments.md)
* [Create an Environment](https://docs.scalr.io/scalr/reference/create_environment.md)
* [Delete an Environment](https://docs.scalr.io/scalr/reference/delete_environment.md)
* [Get an Environment](https://docs.scalr.io/scalr/reference/get_environment.md)
* [Update Environment](https://docs.scalr.io/scalr/reference/update_environment.md)
* [Delete environment's tags](https://docs.scalr.io/scalr/reference/delete_environment_tags.md)
* [List environment's tags](https://docs.scalr.io/scalr/reference/list_environment_tags.md)
* [Replace environment's tags](https://docs.scalr.io/scalr/reference/replace_environment_tags.md)
* [Add tags to the environment](https://docs.scalr.io/scalr/reference/add_environment_tags.md)
* [Lock an Environment](https://docs.scalr.io/scalr/reference/lock_environment.md)