Skip to main content
PUT
/
scripts
/
templates
/
{templateId}
Update a Script Template
curl --request PUT \
  --url https://v1.api.altostrat.io/scripts/templates/{templateId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Disable Guest WiFi (Scheduled)",
  "description": "A script to disable the guest WiFi interface nightly.",
  "content": "/interface wireless disable [find name=\"guest-wifi\"];",
  "metadata": {
    "department": "IT-Security",
    "reviewed": "2025-10-29"
  }
}
'
import requests

url = "https://v1.api.altostrat.io/scripts/templates/{templateId}"

payload = {
    "name": "Disable Guest WiFi (Scheduled)",
    "description": "A script to disable the guest WiFi interface nightly.",
    "content": "/interface wireless disable [find name=\"guest-wifi\"];",
    "metadata": {
        "department": "IT-Security",
        "reviewed": "2025-10-29"
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    name: 'Disable Guest WiFi (Scheduled)',
    description: 'A script to disable the guest WiFi interface nightly.',
    content: '/interface wireless disable [find name="guest-wifi"];',
    metadata: {department: 'IT-Security', reviewed: '2025-10-29'}
  })
};

fetch('https://v1.api.altostrat.io/scripts/templates/{templateId}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://v1.api.altostrat.io/scripts/templates/{templateId}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => json_encode([
    'name' => 'Disable Guest WiFi (Scheduled)',
    'description' => 'A script to disable the guest WiFi interface nightly.',
    'content' => '/interface wireless disable [find name="guest-wifi"];',
    'metadata' => [
        'department' => 'IT-Security',
        'reviewed' => '2025-10-29'
    ]
  ]),
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://v1.api.altostrat.io/scripts/templates/{templateId}"

	payload := strings.NewReader("{\n  \"name\": \"Disable Guest WiFi (Scheduled)\",\n  \"description\": \"A script to disable the guest WiFi interface nightly.\",\n  \"content\": \"/interface wireless disable [find name=\\\"guest-wifi\\\"];\",\n  \"metadata\": {\n    \"department\": \"IT-Security\",\n    \"reviewed\": \"2025-10-29\"\n  }\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.put("https://v1.api.altostrat.io/scripts/templates/{templateId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Disable Guest WiFi (Scheduled)\",\n  \"description\": \"A script to disable the guest WiFi interface nightly.\",\n  \"content\": \"/interface wireless disable [find name=\\\"guest-wifi\\\"];\",\n  \"metadata\": {\n    \"department\": \"IT-Security\",\n    \"reviewed\": \"2025-10-29\"\n  }\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/scripts/templates/{templateId}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Disable Guest WiFi (Scheduled)\",\n  \"description\": \"A script to disable the guest WiFi interface nightly.\",\n  \"content\": \"/interface wireless disable [find name=\\\"guest-wifi\\\"];\",\n  \"metadata\": {\n    \"department\": \"IT-Security\",\n    \"reviewed\": \"2025-10-29\"\n  }\n}"

response = http.request(request)
puts response.read_body
{
  "id": "d9e5b5e3-3e8a-4c2f-8d2a-7e6e5a4b1c0d",
  "name": "Standard Firewall Setup",
  "description": "Applies the standard set of corporate firewall rules to a device.",
  "content": "/ip firewall filter add chain=input action=accept connection-state=established,related",
  "metadata": {
    "version": "1.2",
    "compliance": "PCI-DSS"
  },
  "author": "auth0|642b7f3b8b3b3e3e3e3e3e3e",
  "read_only": false,
  "created_at": "2025-10-29T10:30:00.000000Z",
  "updated_at": "2025-10-29T11:00:00.000000Z"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}
{
  "type": "invalid_request_error",
  "code": "parameter_missing",
  "message": "The 'name' parameter is required for this request.",
  "doc_url": "https://docs.altostrat.io/errors/parameter_missing"
}

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

templateId
string<uuid>
required

The unique identifier for the script template to update.

Example:

"d9e5b5e3-3e8a-4c2f-8d2a-7e6e5a4b1c0d"

Body

application/json
name
string
required

The updated name for the template.

Maximum string length: 100
Example:

"Disable Guest WiFi (Scheduled)"

description
string
required

The updated description.

Maximum string length: 200
Example:

"A script to disable the guest WiFi interface nightly."

content
string
required

The updated script content.

Maximum string length: 5000
Example:

"/interface wireless disable [find name=\"guest-wifi\"];"

metadata
object

Key-value metadata.

Example:
{
  "department": "IT-Security",
  "reviewed": "2025-10-29"
}

Response

The script template was updated successfully.

id
string<uuid>

The unique identifier for the script template.

Example:

"d9e5b5e3-3e8a-4c2f-8d2a-7e6e5a4b1c0d"

name
string

The name of the script template.

Example:

"Standard Firewall Setup"

description
string

A brief description of what the template does.

Example:

"Applies the standard set of corporate firewall rules to a device."

content
string

The full script content of the template.

Example:

"/ip firewall filter add chain=input action=accept connection-state=established,related"

metadata
object | null

A key-value map for storing arbitrary metadata.

Example:
{ "version": "1.2", "compliance": "PCI-DSS" }
author
string<uuid> | null

The user ID of the template's author. Null for global templates.

Example:

"auth0|642b7f3b8b3b3e3e3e3e3e3e"

read_only
boolean

True if the template is global and cannot be edited by the user.

Example:

false

created_at
string<date-time>

The timestamp when the template was created.

Example:

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

updated_at
string<date-time>

The timestamp when the template was last updated.

Example:

"2025-10-29T11:00:00.000000Z"