Skip to main content
PUT
/
scheduled
/
{scheduledScriptId}
Update a Scheduled Script
curl --request PUT \
  --url https://api.altostrat.io/scheduled/{scheduledScriptId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "test_site_id": "site_2Al5z3gXyY5f6Z7h8j9k0l1m",
  "make_backup": true,
  "description": "Nightly BGP peer maintenance (Updated)",
  "script": "/routing bgp peer enable [find name=peer1]",
  "sites": [
    "site_1AbCdEfGhIjKlMnOpQrStUv"
  ],
  "notify": [
    "auth0|5f9d4b3c2e1a0b006f8b4c5d",
    "auth0|6a0e5c4d3f2b1c007g9c5d6e"
  ]
}'
{
  "id": "018f5bda-4690-4432-8472-358b2734f19b",
  "created_by": "auth0|642b7f3b8b3b3e3e3e3e3e3e",
  "test_site_id": "site_2Al5z3gXyY5f6Z7h8j9k0l1m",
  "make_backup": true,
  "abort_if_offline": false,
  "description": "Weekly firewall rule update",
  "summary": "This script adds a firewall filter rule to drop input from a specific address list named \"blacklist\".",
  "script": "/ip firewall filter add action=drop chain=input src-address-list=blacklist",
  "status": "scheduled",
  "authorized_at": "2025-10-30T10:00:00.000000Z",
  "cancelled_at": null,
  "launch_at": "2025-11-01T02:00:00.000000Z",
  "t_minus": "in 2 days",
  "started_at": "2025-11-01T02:00:05.000000Z",
  "sites": [
    "site_1AbCdEfGhIjKlMnOpQrStUv"
  ],
  "notify": [
    "auth0|5f9d4b3c2e1a0b006f8b4c5d"
  ],
  "progress": {
    "completed": [
      "site_1AbCdEfGhIjKlMnOpQrStUv"
    ],
    "failed": [
      "site_2BcDeFgHiJkLmNoPqRsTuVw"
    ],
    "pending": [
      "site_3CdEfGhIjKlMnOpQrStUvWx"
    ]
  },
  "created_at": "2025-10-29T12:44:27.000000Z",
  "updated_at": "2025-10-29T13:05:00.000000Z"
}

Authorizations

Authorization
string
header
required

Altostrat SDX API uses JWT Bearer tokens for authentication. Obtain a token via the Authentication API and include it in the Authorization header as 'Bearer {token}'.

Path Parameters

scheduledScriptId
string<uuid>
required

The unique identifier for the scheduled script to update.

Example:

"018f5bda-4690-4432-8472-358b2734f19b"

Body

application/json
make_backup
boolean
required

If true, create a configuration backup before executing the script.

Example:

true

description
string
required

A human-readable name for the scheduled script.

Example:

"Nightly BGP peer maintenance (Updated)"

script
string
required

The full content of the MikroTik RouterOS script.

Example:

"/routing bgp peer enable [find name=peer1]"

sites
string<uuid>[]
required

An array of site IDs to target.

Example:
["site_1AbCdEfGhIjKlMnOpQrStUv"]
notify
string<uuid>[]
required

An array of user IDs to receive notifications.

Example:
[
"auth0|5f9d4b3c2e1a0b006f8b4c5d",
"auth0|6a0e5c4d3f2b1c007g9c5d6e"
]
test_site_id
string<uuid> | null

The unique identifier of the site designated for test runs.

Example:

"site_2Al5z3gXyY5f6Z7h8j9k0l1m"

Response

The scheduled script was updated successfully.

id
string<uuid>

The unique identifier for the scheduled script.

Example:

"018f5bda-4690-4432-8472-358b2734f19b"

created_by
string<uuid>

The user ID of the person who created the script schedule.

Example:

"auth0|642b7f3b8b3b3e3e3e3e3e3e"

test_site_id
string<uuid> | null

The unique identifier of the site designated for test runs.

Example:

"site_2Al5z3gXyY5f6Z7h8j9k0l1m"

make_backup
boolean

If true, a configuration backup will be created on each target device before the script is executed.

Example:

true

abort_if_offline
boolean

If true, the script execution will be aborted for a site if it is offline at launch time.

Example:

false

description
string

A human-readable name or description for the script schedule.

Example:

"Weekly firewall rule update"

summary
string | null

An AI-generated summary of the script's purpose.

Example:

"This script adds a firewall filter rule to drop input from a specific address list named \"blacklist\"."

script
string

The full content of the MikroTik RouterOS script to be executed.

Example:

"/ip firewall filter add action=drop chain=input src-address-list=blacklist"

status
enum<string>

The current status of the scheduled script.

Available options:
unauthorized,
scheduled,
launched,
cancelled
Example:

"scheduled"

authorized_at
string<date-time> | null

The timestamp when the script execution was authorized. Null if not yet authorized.

Example:

"2025-10-30T10:00:00.000000Z"

cancelled_at
string<date-time> | null

The timestamp when the script was cancelled.

Example:

null

launch_at
string<date-time>

The scheduled UTC date and time for the script to be executed.

Example:

"2025-11-01T02:00:00.000000Z"

t_minus
string | null

A human-readable countdown to the launch time.

Example:

"in 2 days"

started_at
string<date-time> | null

The timestamp when the script execution actually began.

Example:

"2025-11-01T02:00:05.000000Z"

sites
string<uuid>[]

A list of site IDs where the script will be executed.

notify
string<uuid>[]

A list of user IDs to notify about the script's progress and authorization requests.

progress
object

Represents the execution progress of a launched script across its target sites.

created_at
string<date-time>

The timestamp when the scheduled script was created.

Example:

"2025-10-29T12:44:27.000000Z"

updated_at
string<date-time>

The timestamp when the scheduled script was last updated.

Example:

"2025-10-29T13:05:00.000000Z"