Action Setting Modify

PUT{{api_url}}/shop/action/{{action_key}}/setting_modify

Changes one run guard setting for one action. Each action lists the settings it allows under writable_settings in Action List and Action Status, with each setting's type and current value. Only those settings can be changed, and only for the action named in the URL.

Every action guards itself with a running flag so cron never starts a second run on top of one in progress. This call adjusts that guard by hand:

  • Release: set the is_running setting to 0 when a run died without clearing its flag, so the action can run again without waiting for it to go stale.
  • Hold: set the last_run_time setting forward while is_running is 1, so cron and Action Run keep treating the action as running until last_run_time plus max_run_minutes. Use this to keep cron off a long manual run. While held, minutes_running reads negative.

Releasing a run that is still alive lets a second run start alongside it, so check is_running, last_run_time, and the action's logs first. Actions with a running_check of pid mark themselves stale as soon as their process is gone, so they rarely need a release.

Body

Send a JSON body:

  • setting_name is one of the names under the action's writable_settings
  • setting_value is the new value, by the setting's type:
  • bool: 0 or 1 (true and false are also accepted)
  • int: a whole number
  • datetime: Y-m-d H:i:s, in the same time zone as last_run_time in Action Status

Response

  • ok is true when the setting was changed
  • code is the HTTP status, repeated in the body
  • message is Set or the reason nothing was changed
  • setting is the setting name
  • old_value is the value before the change
  • new_value is the value written
  • status is the action state after the change, in the same shape as Action Status

Codes

  • 200 the setting was changed
  • 400 setting_name or setting_value is missing, the setting is not in this action's writable_settings, or the value is wrong for its type; message names it
  • 403 the connection for this action is not enabled
  • 404 the action_key is unknown

Authorization

Bearer token, sent in the Authorization header. Inherited from the collection.

Body

{
    "setting_name": "get_best_buy_orders_is_running",
    "setting_value": 1
}

Example Request

curl --location --request PUT '{{api_url}}/shop/action/{{action_key}}/setting_modify' \
--header 'Authorization: Bearer {{auth_token}}' \
--data '{
    "setting_name": "get_best_buy_orders_is_running",
    "setting_value": 1
}'

Example Responses

Action Setting Modify

Request

curl --location --request POST '{{api_url}}/shop/action/get_best_buy_orders/run' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--data '{
    "setting_name": "get_best_buy_orders_is_running",
    "setting_value": 1
}'

Response 200 OK

{
    "ok": true,
    "code": 200,
    "message": "Set",
    "setting": "get_best_buy_orders_is_running",
    "old_value": "0",
    "new_value": 1,
    "status": {
        "action_key": "get_best_buy_orders",
        "label": "Best Buy: Get Orders",
        "short_ident": "beb",
        "description": "Pulls orders from Best Buy into InfiPlex. last_updated_after (Y-m-d H:i:s, UTC) is required. Creates orders and triggers warehouse routing. Runs on cron; run manually only when you need orders now.",
        "mode": "inline",
        "params": {
            "last_updated_after": "datetime"
        },
        "required": [
            "last_updated_after"
        ],
        "log_types_success": [
            124001
        ],
        "log_types_fail": [
            124000
        ],
        "max_run_minutes": 120,
        "is_running": true,
        "last_run_time": "2025-09-15 13:37:36",
        "minutes_running": 636330,
        "stale": true,
        "can_run": true,
        "retry_after": null,
        "running_check": "time",
        "pid_setting": null,
        "is_running_setting": "get_best_buy_orders_is_running",
        "writable_settings": [
            {
                "setting": "get_best_buy_orders_is_running",
                "type": "bool",
                "value": "1"
            },
            {
                "setting": "get_best_buy_orders_last_run_time",
                "type": "datetime",
                "value": "2025-09-15T13:37:36-05:00"
            }
        ]
    }
}