# REST Resource: accounts.containers.environments

- [Resource: Environment](https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments#Environment)
  - [JSON representation](https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments#Environment.SCHEMA_REPRESENTATION)
- [EnvironmentType](https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments#EnvironmentType)
- [Methods](https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments#METHODS_SUMMARY)

## Resource: Environment

Represents a Google Tag Manager Environment. Note that a user can create, delete and update environments of type USER, but can only update the enableDebug and url fields of environments of other types.

| JSON representation |
|---|
| ``` { "path": string, "accountId": string, "containerId": string, "environmentId": string, "type": enum (`https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments#EnvironmentType`), "fingerprint": string, "name": string, "description": string, "enableDebug": boolean, "url": string, "authorizationCode": string, "authorizationTimestamp": string, "tagManagerUrl": string, // Union field `Link` can be only one of the following: "containerVersionId": string, "workspaceId": string // End of list of possible types for union field `Link`. } ``` |

| Fields ||
|---|---|
| `path` | `string` GTM Environment's API relative path. |
| `accountId` | `string` GTM Account ID. |
| `containerId` | `string` GTM Container ID. |
| `environmentId` | `string` GTM Environment ID uniquely identifies the GTM Environment. |
| `type` | ``enum (`https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments#EnvironmentType`)`` The type of this environment. |
| `fingerprint` | `string` The fingerprint of the GTM environment as computed at storage time. This value is recomputed whenever the environment is modified. |
| `name` | `string` The environment display name. Can be set or changed only on USER type environments. |
| `description` | `string` The environment description. Can be set or changed only on USER type environments. |
| `enableDebug` | `boolean` Whether or not to enable debug by default for the environment. |
| `url` | `string` Default preview page url for the environment. |
| `authorizationCode` | `string` The environment authorization code. |
| `authorizationTimestamp` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The last update time-stamp for the authorization code. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `tagManagerUrl` | `string` Auto generated link to the tag manager UI |
| Union field `Link`. The version ID, workspace id or none. May contain other IDs in the future. Can be set or changed only on USER type environments. `Link` can be only one of the following: ||
| `containerVersionId` | `string` Represents a link to a container version. |
| `workspaceId` | `string` Represents a link to a quick preview of a workspace. |

## EnvironmentType

| Enums ||
|---|---|
| `user` | Points to a user defined environment. |
| `live` | Points to the current live container version. |
| `latest` | Points to the latest container version. |
| `workspace` | Automatically managed environment that points to a workspace preview or version created by a workspace. |

| ## Methods ||
|---|---|
| ### `https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments/create` | Creates a GTM Environment. |
| ### `https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments/delete` | Deletes a GTM Environment. |
| ### `https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments/get` | Gets a GTM Environment. |
| ### `https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments/list` | Lists all GTM Environments of a GTM Container. |
| ### `https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments/reauthorize` | Re-generates the authorization code for a GTM Environment. |
| ### `https://developers.google.com/tag-platform/tag-manager/api/reference/rest/v2/accounts.containers.environments/update` | Updates a GTM Environment. |