Index: asterisk-22.8.2/res/ari/resource_channels.c
===================================================================
--- asterisk-22.8.2.orig/res/ari/resource_channels.c
+++ asterisk-22.8.2/res/ari/resource_channels.c
@@ -1574,6 +1574,21 @@ void ast_ari_channels_set_channel_var(st
 		return;
 	}
 
+	if (args->bypass_stasis) {
+		struct ast_channel *channel = ast_channel_get_by_name(args->channel_id);
+
+		if (!channel) {
+			ast_ari_response_error(response, 404, "Not Found", "Channel not found");
+			return;
+		}
+
+		pbx_builtin_setvar_helper(channel, args->variable, args->value);
+		ast_channel_unref(channel);
+
+		ast_ari_response_no_content(response);
+		return;
+	}
+
 	control = find_control(response, args->channel_id);
 	if (control == NULL) {
 		/* response filled in by find_control */
Index: asterisk-22.8.2/res/ari/resource_channels.h
===================================================================
--- asterisk-22.8.2.orig/res/ari/resource_channels.h
+++ asterisk-22.8.2/res/ari/resource_channels.h
@@ -706,6 +706,8 @@ struct ast_ari_channels_set_channel_var_
 	const char *variable;
 	/*! The value to set the variable to */
 	const char *value;
+	/*! Set the variable even if the channel is not in Stasis application */
+	int bypass_stasis;
 };
 /*!
  * \brief Body parsing function for /channels/{channelId}/variable.
Index: asterisk-22.8.2/res/res_ari_channels.c
===================================================================
--- asterisk-22.8.2.orig/res/res_ari_channels.c
+++ asterisk-22.8.2/res/res_ari_channels.c
@@ -2484,6 +2484,10 @@ int ast_ari_channels_set_channel_var_par
 	if (field) {
 		args->value = ast_json_string_get(field);
 	}
+	field = ast_json_object_get(body, "bypassStasis");
+	if (field) {
+		args->bypass_stasis = ast_json_is_true(field);
+	}
 	return 0;
 }
 
@@ -2515,6 +2519,9 @@ static void ast_ari_channels_set_channel
 		if (strcmp(i->name, "value") == 0) {
 			args.value = (i->value);
 		} else
+		if (strcmp(i->name, "bypassStasis") == 0) {
+			args.bypass_stasis = ast_true(i->value);
+		} else
 		{}
 	}
 	for (i = path_vars; i; i = i->next) {
Index: asterisk-22.8.2/rest-api/api-docs/channels.json
===================================================================
--- asterisk-22.8.2.orig/rest-api/api-docs/channels.json
+++ asterisk-22.8.2/rest-api/api-docs/channels.json
@@ -1601,6 +1601,15 @@
 							"required": false,
 							"allowMultiple": false,
 							"dataType": "string"
+						},
+						{
+							"name": "bypassStasis",
+							"description": "Set the variable even if the channel is not in Stasis application",
+							"paramType": "query",
+							"required": false,
+							"allowMultiple": false,
+							"dataType": "boolean",
+							"defaultValue": false
 						}
 					],
 					"errorResponses": [
