---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/mrt](../index.md) / updateEnvironmentVariablesScapi

# Function: updateEnvironmentVariablesScapi()

> **updateEnvironmentVariablesScapi**(`conn`, `params`): `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/operations/mrt/env-var.ts:472](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/bceb8da43dd8bc63d57932bbd905d36a1b40c949/packages/b2c-tooling-sdk/src/operations/mrt/env-var.ts#L472)

Updates environment variables via the SCAPI MRT Environments API using a
merge-PATCH: a present key is created/replaced, a `null` value deletes the
key, and omitted keys are left unchanged. The endpoint returns 204 No Content
on success — there is no response body, so only `error` is inspected.

## Parameters

### conn

[`ScapiMrtConnection`](../interfaces/ScapiMrtConnection.md)

### params

#### environmentId

`string`

#### storefrontId

`string`

#### variables

`Record`\<`string`, `string` \| `null`\>

## Returns

`Promise`\<`void`\>

## Throws

carrying the HTTP status on a non-2xx response.
