---
title: "Favorite a environment"
method: POST
path: "/environments/{environment}/actions/favorite"
tags: ["favorite-environments"]
---

# Favorite a environment

`POST /environments/{environment}/actions/favorite`

## Request

- Base URL: `https://example.scalr.io/api/iacp/v3`
- URL: `https://example.scalr.io/api/iacp/v3/environments/{environment}/actions/favorite`
- Auth: HTTP bearer

Add an environment to the current user's favorites.

## Path parameters

- `environment` string, required

## Response `200`

Success.

- EnvironmentDocument: JSON:API Document. see: https://jsonapi.org/format/#document-structure
  - `data` Environment: Environments are collections of related workspaces that correspond to functional areas, SDLC stages, projects or any grouping that is required. An account can have multiple environments. Workspaces within an environment are where Terraform configurations are run to deploy infrastructure, and where state files are stored. An Environment can have set of policy groups assigned that are applied to all workspaces in the environment. The Environment can also have variables, credentials, registry modules, and VCS providers that are available to every workspace.
    - `attributes` object, required
      - `created-at` string, date-time: Date/Time the environment was created.
      - `created-by-email` string, nullable
      - `favorite` boolean: Indicates whether the environment is marked as favorite by the current user.
      - `is-federated-to-account` boolean: Allow all current and future environments to have access to this environment.
      - `lock-reason` string, nullable: The reason (if any) that the environment has been locked.
      - `locked` boolean: Whether the environment is locked. If locked runs won't be queued to execute.
      - `mask-sensitive-output` boolean: Enable masking of the sensitive console output.
      - `name` string, required: The name of the environment.
      - `permissions` object
      - `remote-backend` boolean: 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.
      - `remote-backend-overridable` boolean: Indicates if the remote backend configuration can be overridden on the workspace level.
      - `status` string
      - `updated-at` string, date-time, nullable: Date/Time when the environment was last updated.
    - `id` string
    - `links` object
      - `self` string
    - `relationships` object
      - `account` object: The account that owns this environment.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'accounts' | '', required
      - `created-by` object: The user that created the environment.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'users' | '', required
      - `default-provider-configurations` object: Provider configurations used in the environment workspaces by default.
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'provider-configurations' | '', required
      - `default-workspace-agent-pool` object: 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.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'agent-pools' | '', required
      - `drift-detection-schedules` object: The drift detection schedules for this environment
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'drift-detection-schedule' | '', required
      - `locked-by` object: The user that locked this environment.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'users' | '', required
      - `policy-groups` object
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'policy-groups' | '', required
      - `provider-configurations` object: Provider configurations available for this environment.
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'provider-configurations' | '', required
      - `storage-profile` object: The storage profile for this environment. If not set, the account's default storage profile will be used.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'storage-profiles' | '', required
      - `tags` object
        - `data` object[], nullable, required
          - `id` string, required
          - `type` 'tags' | '', required
      - `updated-by` object: The last user that updated this environment.
        - `data` object, nullable, required
          - `id` string, required
          - `type` 'users' | '', required
    - `type` 'environments', required
  - `included` object[]
  - `meta` object

## Other responses

- `404`: Environment not found or user unauthorized to perform action.
- `4XX`: Client error.
- `5XX`: Server error.

---

[API](https://skmtc.dev/scalr/apis/scalr-iacp-api.md) - [All operations](https://skmtc.dev/scalr/apis/scalr-iacp-api/llms.txt) - [OpenAPI document](https://skmtc.dev/scalr/apis/scalr-iacp-api/revisions/d3e1dc85657a?raw)
