---
updatedAt: 2026-08-06T09:23:24.000Z
agentTools:
  projectIndex: https://developers.alcmeon.com/llms.txt
---

# Set a global scenario variable

Create a new global variable or update an existing one with the given name and value

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.alcmeon.com",
      "description": "Alcmeon production API server"
    }
  ],
  "info": {
    "title": "Core API",
    "version": "1.0"
  },
  "x-readme": {
    "explorer-enabled": true
  },
  "components": {
    "securitySchemes": {
      "basic_auth": {
        "description": "Basic authentication using your environment Instance ID as username and Application Secret as password.\n",
        "type": "http",
        "scheme": "basic"
      },
      "bearer_token": {
        "description": "OAuth 2.0 Bearer token authentication.  Obtain a token by calling the /v1/oauth2/token endpoint with your credentials. The token is valid for one hour.\n",
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "ResponseError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "A short string explaining the reason of the error."
          },
          "details": {
            "type": "string",
            "description": "A short string which describes what is wrong. Provide this string to support@alcmeon.com if you wish to obtain more details about the problem.\n"
          }
        }
      },
      "RateLimitResponseError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string",
            "description": "Rate limit reached"
          },
          "details": {
            "type": "string",
            "description": "A string showing the time when the rate limit will be reset. Example: {'rate_limited_until': '2024-01-22T13:05:41Z'}\n"
          }
        }
      },
      "GlobalVariable": {
        "type": "object",
        "description": "A global scenario variable with its name and value",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name/key of the global variable",
            "example": "max_retries"
          },
          "value": {
            "description": "The value of the global variable (can be any JSON-serializable type)",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "object"
              },
              {
                "type": "array"
              }
            ],
            "example": 3
          }
        },
        "required": [
          "name",
          "value"
        ]
      },
      "SetGlobalVariableRequest": {
        "type": "object",
        "description": "Request body for setting a global variable",
        "properties": {
          "name": {
            "type": "string",
            "description": "The name/key of the global variable to set",
            "minLength": 1,
            "maxLength": 100,
            "example": "api_timeout"
          },
          "value": {
            "description": "The value to set for the global variable (can be any JSON-serializable type)",
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              },
              {
                "type": "number"
              },
              {
                "type": "boolean"
              },
              {
                "type": "object"
              },
              {
                "type": "array"
              }
            ],
            "example": 30.5
          }
        },
        "required": [
          "name",
          "value"
        ]
      }
    }
  },
  "security": [
    {
      "basic_auth": []
    },
    {
      "bearer_token": []
    }
  ],
  "paths": {
    "/v1/global-variables": {
      "put": {
        "tags": [
          "Global variables"
        ],
        "summary": "Set a global scenario variable",
        "description": "Create a new global variable or update an existing one with the given name and value",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetGlobalVariableRequest"
              },
              "examples": {
                "string_value": {
                  "summary": "Set a string variable",
                  "value": {
                    "name": "welcome_message",
                    "value": "Hello, welcome to our service!"
                  }
                },
                "integer_value": {
                  "summary": "Set an integer variable",
                  "value": {
                    "name": "max_retries",
                    "value": 3
                  }
                },
                "float_value": {
                  "summary": "Set a float variable",
                  "value": {
                    "name": "api_timeout",
                    "value": 30.5
                  }
                },
                "boolean_value": {
                  "summary": "Set a boolean variable",
                  "value": {
                    "name": "feature_enabled",
                    "value": true
                  }
                },
                "object_value": {
                  "summary": "Set an object variable",
                  "value": {
                    "name": "config",
                    "value": {
                      "environment": "production",
                      "debug": false,
                      "settings": [
                        "option1",
                        "option2"
                      ]
                    }
                  }
                },
                "array_value": {
                  "summary": "Set an array variable",
                  "value": {
                    "name": "allowed_domains",
                    "value": [
                      "example.com",
                      "test.com",
                      "demo.com"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successfully set the global variable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GlobalVariable"
                },
                "examples": {
                  "created_variable": {
                    "summary": "Successfully created new variable",
                    "value": {
                      "name": "new_feature_flag",
                      "value": true
                    }
                  },
                  "updated_variable": {
                    "summary": "Successfully updated existing variable",
                    "value": {
                      "name": "max_retries",
                      "value": 5
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid request body",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseError"
                },
                "examples": {
                  "missing_name": {
                    "summary": "Missing required name field",
                    "value": {
                      "error": "Invalid request body",
                      "details": "Missing required field: name"
                    }
                  },
                  "missing_value": {
                    "summary": "Missing required value field",
                    "value": {
                      "error": "Invalid request body",
                      "details": "Missing required field: value"
                    }
                  },
                  "invalid_json": {
                    "summary": "Invalid JSON format",
                    "value": {
                      "error": "Invalid request body",
                      "details": "Invalid JSON format"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit reached. Default limit is set to 15 requests per minute.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitResponseError"
                }
              }
            }
          }
        }
      }
    }
  }
}
```