---
title: "Updates the Component environment variables based on the specified Component Id"
method: PUT
path: "/components/{component_id}/env"
tags: ["components"]
---

# Updates the Component environment variables based on the specified Component Id

`PUT /components/{component_id}/env`

The component should be accessible to the client (e.g. component from the own Contract or shared one).

## Path parameters

- `component_id` string, required

## Request body

- object
  - `data` object, required
    - `id` string, required
    - `type` 'component-env', required
    - `links` object, required
      - `self` string, required
    - `attributes` object, required
      - `vars` object, required — JSON object representing environmental variables mapped to their values
  - `meta` object, required

## Response `200`

OK

- object
  - `data` object, required
    - `id` string, required
    - `type` 'component-env', required
    - `links` object, required
      - `self` string, required
    - `attributes` object, required
      - `vars` object, required — JSON object representing environmental variables mapped to their values
  - `meta` object, required

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/elastic/apis/elastic-io-rest-api-documentation-v2.md) · [All operations](https://skmtc.net/elastic/apis/elastic-io-rest-api-documentation-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/elastic/elastic-io-rest-api-documentation-v2/revisions/411f9f98c01e/schema)
