Skip to main content
PUT
/
captive
/
instances
/
{instanceId}
Update a captive portal instance
curl --request PUT \
  --url https://v1.api.altostrat.io/captive/instances/{instanceId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Main Office Guest WiFi",
  "strategy": "oauth2",
  "session_ttl": 43200,
  "auth_integration_id": "c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f",
  "auth_window_ttl": 300,
  "theme": {
    "accent_text": "#FFFFFF",
    "accent_color": "#0396d5",
    "text_color": "#4f4f4f",
    "secondary_text_color": "#8f8f8f",
    "background_color": "#f9f9f9",
    "border_color": "#e0e0e0",
    "box_color": "#ffffff"
  },
  "terms_text": "By connecting, you agree to our terms of service...",
  "sites": [
    {
      "id": "a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6",
      "subnets": [
        "192.168.88.0/24"
      ]
    }
  ]
}
'
import requests

url = "https://v1.api.altostrat.io/captive/instances/{instanceId}"

payload = {
"name": "Main Office Guest WiFi",
"strategy": "oauth2",
"session_ttl": 43200,
"auth_integration_id": "c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f",
"auth_window_ttl": 300,
"theme": {
"accent_text": "#FFFFFF",
"accent_color": "#0396d5",
"text_color": "#4f4f4f",
"secondary_text_color": "#8f8f8f",
"background_color": "#f9f9f9",
"border_color": "#e0e0e0",
"box_color": "#ffffff"
},
"terms_text": "By connecting, you agree to our terms of service...",
"sites": [
{
"id": "a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6",
"subnets": ["192.168.88.0/24"]
}
]
}
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: 'Main Office Guest WiFi',
strategy: 'oauth2',
session_ttl: 43200,
auth_integration_id: 'c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f',
auth_window_ttl: 300,
theme: {
accent_text: '#FFFFFF',
accent_color: '#0396d5',
text_color: '#4f4f4f',
secondary_text_color: '#8f8f8f',
background_color: '#f9f9f9',
border_color: '#e0e0e0',
box_color: '#ffffff'
},
terms_text: 'By connecting, you agree to our terms of service...',
sites: [{id: 'a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6', subnets: ['192.168.88.0/24']}]
})
};

fetch('https://v1.api.altostrat.io/captive/instances/{instanceId}', 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/captive/instances/{instanceId}",
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' => 'Main Office Guest WiFi',
'strategy' => 'oauth2',
'session_ttl' => 43200,
'auth_integration_id' => 'c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f',
'auth_window_ttl' => 300,
'theme' => [
'accent_text' => '#FFFFFF',
'accent_color' => '#0396d5',
'text_color' => '#4f4f4f',
'secondary_text_color' => '#8f8f8f',
'background_color' => '#f9f9f9',
'border_color' => '#e0e0e0',
'box_color' => '#ffffff'
],
'terms_text' => 'By connecting, you agree to our terms of service...',
'sites' => [
[
'id' => 'a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6',
'subnets' => [
'192.168.88.0/24'
]
]
]
]),
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/captive/instances/{instanceId}"

payload := strings.NewReader("{\n \"name\": \"Main Office Guest WiFi\",\n \"strategy\": \"oauth2\",\n \"session_ttl\": 43200,\n \"auth_integration_id\": \"c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f\",\n \"auth_window_ttl\": 300,\n \"theme\": {\n \"accent_text\": \"#FFFFFF\",\n \"accent_color\": \"#0396d5\",\n \"text_color\": \"#4f4f4f\",\n \"secondary_text_color\": \"#8f8f8f\",\n \"background_color\": \"#f9f9f9\",\n \"border_color\": \"#e0e0e0\",\n \"box_color\": \"#ffffff\"\n },\n \"terms_text\": \"By connecting, you agree to our terms of service...\",\n \"sites\": [\n {\n \"id\": \"a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6\",\n \"subnets\": [\n \"192.168.88.0/24\"\n ]\n }\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/captive/instances/{instanceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Main Office Guest WiFi\",\n \"strategy\": \"oauth2\",\n \"session_ttl\": 43200,\n \"auth_integration_id\": \"c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f\",\n \"auth_window_ttl\": 300,\n \"theme\": {\n \"accent_text\": \"#FFFFFF\",\n \"accent_color\": \"#0396d5\",\n \"text_color\": \"#4f4f4f\",\n \"secondary_text_color\": \"#8f8f8f\",\n \"background_color\": \"#f9f9f9\",\n \"border_color\": \"#e0e0e0\",\n \"box_color\": \"#ffffff\"\n },\n \"terms_text\": \"By connecting, you agree to our terms of service...\",\n \"sites\": [\n {\n \"id\": \"a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6\",\n \"subnets\": [\n \"192.168.88.0/24\"\n ]\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/captive/instances/{instanceId}")

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\": \"Main Office Guest WiFi\",\n \"strategy\": \"oauth2\",\n \"session_ttl\": 43200,\n \"auth_integration_id\": \"c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f\",\n \"auth_window_ttl\": 300,\n \"theme\": {\n \"accent_text\": \"#FFFFFF\",\n \"accent_color\": \"#0396d5\",\n \"text_color\": \"#4f4f4f\",\n \"secondary_text_color\": \"#8f8f8f\",\n \"background_color\": \"#f9f9f9\",\n \"border_color\": \"#e0e0e0\",\n \"box_color\": \"#ffffff\"\n },\n \"terms_text\": \"By connecting, you agree to our terms of service...\",\n \"sites\": [\n {\n \"id\": \"a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6\",\n \"subnets\": [\n \"192.168.88.0/24\"\n ]\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "9a7f1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c",
  "auth_integration_id": "c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f",
  "strategy": "oauth2",
  "name": "Main Office Guest WiFi",
  "session_ttl": 43200,
  "auth_window_ttl": 300,
  "theme": {
    "logo": "https://v1.api.altostrat.io/captive/assets/.../logo_abc123.png?signature=...",
    "icon": "https://v1.api.altostrat.io/captive/assets/.../icon_def456.png?signature=...",
    "accent_text": "#FFFFFF",
    "accent_color": "#0396d5",
    "text_color": "#4f4f4f",
    "secondary_text_color": "#8f8f8f",
    "background_color": "#f9f9f9",
    "border_color": "#e0e0e0",
    "box_color": "#ffffff"
  },
  "terms_text": "By connecting, you agree to our terms of service...",
  "sites": [
    {
      "id": "a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6",
      "subnets": [
        "192.168.88.0/24"
      ]
    }
  ],
  "created_at": "2025-10-29T12:00:00Z",
  "preview_url": "https://captive.altostr.at/preauth?token=eyJpdiI6..."
}
{
"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

API Key authentication. Provide your token in the 'Authorization' header. Example: Authorization: Bearer <YOUR_TOKEN>

Path Parameters

instanceId
string<uuid>
required

The unique identifier for the captive portal instance.

Example:

"9a7f1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c"

Body

application/json
name
string
required

A human-readable name for the instance.

Example:

"Main Office Guest WiFi"

strategy
enum<string>
required

The authentication method for this captive portal.

Available options:
oauth2,
coupon
Example:

"oauth2"

session_ttl
integer
required

The duration in seconds that a user's session remains active after authentication. Minimum 1200, maximum 604800.

Example:

43200

auth_integration_id
string<uuid> | null

Required if strategy is 'oauth2'. The ID of a pre-configured authentication integration.

Example:

"c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f"

auth_window_ttl
integer

For OAuth2 strategy, the duration in seconds to open the walled garden for authentication. Minimum 120, maximum 900.

Example:

300

theme
object

A collection of branding and appearance settings.

terms_text
string | null

The text of the terms and conditions.

Example:

"By connecting, you agree to our terms of service..."

sites
object[]

An array of sites and their associated subnets where this instance is active.

Response

The captive portal instance was updated successfully.

id
string<uuid>

The unique identifier for the instance.

Example:

"9a7f1b2c-3d4e-5f6a-7b8c-9d0e1f2a3b4c"

auth_integration_id
string<uuid> | null

The ID of the authentication integration used if the strategy is 'oauth2'. Null for 'coupon' strategy.

Example:

"c4d5e6f7-8a9b-0c1d-2e3f-4a5b6c7d8e9f"

strategy
enum<string>

The authentication method for this captive portal.

Available options:
oauth2,
coupon
Example:

"oauth2"

name
string

A human-readable name for the instance.

Example:

"Main Office Guest WiFi"

session_ttl
integer

The duration in seconds that a user's session remains active after successful authentication.

Example:

43200

auth_window_ttl
integer

For OAuth2 strategy, the duration in seconds that the walled garden is temporarily opened to allow the user to complete authentication with the identity provider.

Example:

300

theme
object

A collection of branding and appearance settings.

terms_text
string | null

The text of the terms and conditions that can be displayed to the user.

Example:

"By connecting, you agree to our terms of service..."

sites
object[]

A list of sites and their subnets where this captive portal instance is active.

created_at
string<date-time>

The timestamp when the instance was created.

Example:

"2025-10-29T12:00:00Z"

preview_url
string<uri> | null

A temporary, signed URL to preview the captive portal's appearance.

Example:

"https://captive.altostr.at/preauth?token=eyJpdiI6..."