Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.vpn_sessions.refresh_password(vpn_session_id="vpn_pRMLydp0dQKr1")
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.VpnSessions.RefreshPassword(ctx, "vpn_pRMLydp0dQKr1")
if err != nil {
log.Fatal(err)
}
if res.VpnSessionWithPassword != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.vpnSessions.refreshPassword({
vpnSessionId: "vpn_pRMLydp0dQKr1",
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password \
--header 'Authorization: <api-key>'const options = {method: 'PATCH', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password', 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://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "vpn_pRMLydp0dQKr1",
"type": "vpn_sessions",
"attributes": {
"user_name": "Alexis",
"password": "34xr0yTqaTrNyJFI",
"port": "8443",
"host": "fw04-mh1.maxi.host",
"region": {
"city": "São Paulo 279",
"country": "Germany 292",
"site": {
"id": "loc_3YjJOLexdvZ87",
"name": "São Paulo 279",
"slug": "SAO",
"facility": "São Paulo 279"
}
},
"expires_at": "2026-01-14T15:58:20+00:00",
"created_at": "2026-01-14T15:57:20+00:00",
"updated_at": "2026-01-14T15:57:20+00:00"
}
},
"meta": {}
}VPN Sessions
Refresh VPN session
Refreshing an existing VPN Session will create new credentials for that session
PATCH
/
vpn_sessions
/
{vpn_session_id}
/
refresh_password
Python (SDK)
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.vpn_sessions.refresh_password(vpn_session_id="vpn_pRMLydp0dQKr1")
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.VpnSessions.RefreshPassword(ctx, "vpn_pRMLydp0dQKr1")
if err != nil {
log.Fatal(err)
}
if res.VpnSessionWithPassword != nil {
// handle response
}
}import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.vpnSessions.refreshPassword({
vpnSessionId: "vpn_pRMLydp0dQKr1",
});
console.log(result);
}
run();curl --request PATCH \
--url https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password \
--header 'Authorization: <api-key>'const options = {method: 'PATCH', headers: {Authorization: '<api-key>'}};
fetch('https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password', 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://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.patch("https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/vpn_sessions/{vpn_session_id}/refresh_password")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "vpn_pRMLydp0dQKr1",
"type": "vpn_sessions",
"attributes": {
"user_name": "Alexis",
"password": "34xr0yTqaTrNyJFI",
"port": "8443",
"host": "fw04-mh1.maxi.host",
"region": {
"city": "São Paulo 279",
"country": "Germany 292",
"site": {
"id": "loc_3YjJOLexdvZ87",
"name": "São Paulo 279",
"slug": "SAO",
"facility": "São Paulo 279"
}
},
"expires_at": "2026-01-14T15:58:20+00:00",
"created_at": "2026-01-14T15:57:20+00:00",
"updated_at": "2026-01-14T15:57:20+00:00"
}
},
"meta": {}
}Was this page helpful?
⌘I