---
updatedAt: 2026-06-12T17:02:44.000Z
agentTools:
  projectIndex: https://developer.spreedly.com/llms.txt
---

# Update environment

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.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Spreedly API V1",
    "version": "v1",
    "description": "An OpenAPI specification file for V1 of the Spreedly Core Transactional API"
  },
  "x-explorer-enabled": false,
  "components": {
    "securitySchemes": {
      "basic_auth": {
        "type": "http",
        "scheme": "basic",
        "description": "Unless otherwise noted, all calls to the Spreedly API use [HTTP basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication) over HTTPS.\n            Use the [environment key](https://developer.spreedly.com/docs/the-spreedly-app#environment-key) of the Spreedly environment you wish to execute against as the HTTP basic user, and one of your organization's [access secrets](https://developer.spreedly.com/docs/the-spreedly-app#access-secrets) as the HTTP basic password."
      }
    },
    "schemas": {
      "errors": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "attribute": {
              "type": "string",
              "description": "Which attribute(s) have an error"
            },
            "key": {
              "type": "string",
              "description": "Error Key"
            },
            "message": {
              "type": "string",
              "description": "Error Message"
            }
          },
          "required": [
            "key",
            "message"
          ]
        }
      },
      "environment_properties": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "The key identifying the environment at Spreedly."
          },
          "signing_secret": {
            "type": "string",
            "description": "The secret used to sign callbacks that are made back into your application."
          },
          "organization_key": {
            "type": "string",
            "description": "The organization that the environment belongs to."
          },
          "callback_url": {
            "type": "string",
            "description": "The url where Spreedly will attempt delivery of account updater transaction results. Transaction results are posted in JSON format."
          },
          "smart_routing_enabled": {
            "type": "boolean",
            "description": "If the environment has smart routing enabled or not."
          },
          "allow_direct_api_payment_method_creation": {
            "type": "boolean",
            "description": "If the environment allows payment method creation from anywhere, or only from Spreedly Express or Iframe."
          },
          "name": {
            "type": "string",
            "description": "The human readable name of the environment."
          },
          "default_gateway_token": {
            "type": "string",
            "description": "The default gateway to send transactions if smart routing is enabled."
          },
          "payment_method_management_enabled": {
            "type": "boolean",
            "description": "If an environment is enabled to manage payment methods with Advanced Vaulting."
          },
          "au_enabled": {
            "type": "boolean",
            "description": "If the environment has account updater enabled."
          },
          "retry": {
            "type": "boolean",
            "description": "If the environment has retry enabled."
          },
          "iframe_enhanced_security_enabled": {
            "type": "boolean",
            "description": "If the environment is enabled to pass enhanced security fields to iFrame init."
          }
        }
      },
      "environment_update": {
        "type": "object",
        "properties": {
          "environment": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "The human readable name of the environment. There is a 100 character limit and it cannot contain the following characters: ``\\ | ` # $ % { } ; \" < >``"
              },
              "callback_url": {
                "type": "string",
                "description": "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": {
                "type": "boolean",
                "description": "If the environment allows payment method creation from anywhere, or only from Spreedly Express or Iframe (default: true)."
              },
              "au_enabled": {
                "type": "boolean",
                "description": "If the environment should have cards sent to Account Updater or not (default: false)."
              },
              "payment_method_management_enabled": {
                "type": "boolean",
                "description": "If an environment is enabled to manage payment methods with Advanced Vaulting."
              },
              "smart_routing_enabled": {
                "type": "boolean",
                "description": "If an environment has smart routing enabled or not (default: false)."
              },
              "default_gateway_token": {
                "type": "string",
                "description": "The default gateway to send transactions if smart routing is enabled (default: null)."
              },
              "iframe_enhanced_security_enabled": {
                "type": "boolean",
                "description": "If the environment is enabled to pass enhanced security fields to iFrame init."
              }
            }
          }
        }
      },
      "environment_response": {
        "type": "object",
        "properties": {
          "environment": {
            "$ref": "#/components/schemas/environment_properties"
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://core.spreedly.com/v1"
    }
  ],
  "paths": {
    "/environments/{environment_key}": {
      "parameters": [
        {
          "name": "environment_key",
          "in": "path",
          "description": "The key of the environment to execute against",
          "required": true,
          "schema": {
            "type": "string"
          }
        }
      ],
      "put": {
        "summary": "Update environment",
        "tags": [
          "environments"
        ],
        "security": [
          {
            "basic_auth": []
          }
        ],
        "operationId": "update-environments",
        "description": "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.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/environment_response"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/environment_response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/errors"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/errors"
                }
              },
              "application/xml": {
                "schema": {
                  "$ref": "#/components/schemas/errors"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/environment_update"
              }
            },
            "application/xml": {
              "schema": {
                "$ref": "#/components/schemas/environment_update"
              }
            }
          }
        }
      }
    }
  }
}
```