---
title: "Update environment"
method: PUT
path: "/environments/{environment_key}"
tags: ["environments"]
---

# Update environment

`PUT /environments/{environment_key}`

Update an existing environment. This call should be authenticated with the key of the environment that you are trying to update and an Organization Access Secret.

## Request body

- EnvironmentUpdate
  - `environment` object
    - `name` string — The human readable name of the environment. There is a 100 character limit and it cannot contain the following characters: ``\ | ` # $ % { } ; " < >``
    - `callback_url` string — The url where Spreedly will attempt delivery of account updater transaction results. Transaction results are posted in JSON format. (default: null)
    - `allow_direct_api_method_creation` boolean — If the environment allows payment method creation from anywhere, or only from Spreedly Express or Iframe (default: true).
    - `au_enabled` boolean — If the environment should have cards sent to Account Updater or not (default: false).
    - `payment_method_management_enabled` boolean — If an environment is enabled to manage payment methods with Advanced Vaulting.
    - `smart_routing_enabled` boolean — If an environment has smart routing enabled or not (default: false).
    - `default_gateway_token` string — The default gateway to send transactions if smart routing is enabled (default: null).
    - `iframe_enhanced_security_enabled` boolean — If the environment is enabled to pass enhanced security fields to iFrame init.

## Response `200`

Successful

- EnvironmentResponse
  - `environment` EnvironmentProperties
    - `key` string — The key identifying the environment at Spreedly.
    - `signing_secret` string — The secret used to sign callbacks that are made back into your application.
    - `organization_key` string — The organization that the environment belongs to.
    - `callback_url` string — The url where Spreedly will attempt delivery of account updater transaction results. Transaction results are posted in JSON format.
    - `smart_routing_enabled` boolean — If the environment has smart routing enabled or not.
    - `allow_direct_api_payment_method_creation` boolean — If the environment allows payment method creation from anywhere, or only from Spreedly Express or Iframe.
    - `name` string — The human readable name of the environment.
    - `default_gateway_token` string — The default gateway to send transactions if smart routing is enabled.
    - `payment_method_management_enabled` boolean — If an environment is enabled to manage payment methods with Advanced Vaulting.
    - `au_enabled` boolean — If the environment has account updater enabled.
    - `retry` boolean — If the environment has retry enabled.
    - `iframe_enhanced_security_enabled` boolean — If the environment is enabled to pass enhanced security fields to iFrame init.

## Other responses

- `401` — Unauthorized
- `422` — Unprocessable entity

---

[API](https://skmtc.dev/spreedly/apis/spreedly-api-v1.md) · [All operations](https://skmtc.dev/spreedly/apis/spreedly-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/spreedly/spreedly-api-v1/revisions/72ba4e23e65c/schema)
