---
title: "Create a Shared Value for an Environment"
method: POST
path: "/orgs/{orgId}/apps/{appId}/envs/{envId}/values"
tags: ["public", "Value"]
---

# Create a Shared Value for an Environment

`POST /orgs/{orgId}/apps/{appId}/envs/{envId}/values`

The Shared Value created will only be available to the specific Environment.

If a Value is marked as a secret, it will be securely stored. It will not be possible to retrieve the value again through the API. The value of the secret can however be updated.

## Path parameters

- `orgId` string, required
- `appId` string, required
- `envId` string, required

## Request body

- ValueCreatePayloadRequest
  - `description` string, nullable, required
  - `is_secret` boolean
  - `key` string, required
  - `value` string, nullable
  - `secret_ref` SecretReference, nullable — It stores sensitive value in the organization primary store or a reference to a sensitive value stored in a store registered under the organization.
    - `store` string — Secret Store id. This can't be `humanitec` (our internal Secret Store). It's mandatory if `ref` is defined and can't be used if `value` is defined.
    - `ref` string — Secret reference in the format of the target store. It can't be defined if `value` is defined.
    - `version` string — Optional, only valid if `ref` is defined. It's the version of the secret as defined in the target store.
    - `value` string — Value to store in the secret store. It can't be defined if `ref` is defined.

## Response `201`

Shared Value successfully created.

- ValueResponse — Shared Values can be used to manage variables and configuration that might vary between environments. They are also the way that secrets can be stored securely. Shared Values are by default shared across all environments in an application. However, they can be overridden on an Environment by Environment basis. For example: There might be 2 API keys that are used in an application. One development key used in the development and staging environments and another used for production. The development API key would be set at the Application level. The value would then be overridden at the Environment level for the production Environment.
  - `created_at` string, date-time, required
  - `description` string, required — A Human friendly description of what the Shared Value is.
  - `is_secret` boolean, required — Specified that the Shared Value contains a secret.
  - `key` string, required — The unique key by which the Shared Value can be referenced. pattern: ^[a-zA-Z0-9._-]+$.
  - `secret_key` string, nullable, required — Location of the secret value in the secret store.
  - `secret_store_id` string, nullable, required
  - `secret_version` string, nullable, required — Version of the current secret value as returned by the secret store.
  - `source` 'app' | 'env', required — Source of the value, "app" for app level, "env" for app env level.
  - `updated_at` string, date-time, required
  - `value` string, required — The value that will be stored. (Will be always empty for secrets.)

## Other responses

- `400` — Input not valid.
- `409` — Shared Value already exists.

---

[API](https://skmtc.net/humanitec/apis/humanitec-api.md) · [All operations](https://skmtc.net/humanitec/apis/humanitec-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/humanitec/humanitec-api/revisions/e21ad140ec3c/schema)
