import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.vpn_sessions.create(data={
"attributes": {
"site": latitudesh_python_sdk.PostVpnSessionVpnSessionsSite.SAO,
"server_id": "sv_LMmAD8wyqwop2",
},
})
# Handle response
print(res){
"data": {
"id": "vpn_VLMmAD8EOwop2",
"type": "vpn_sessions",
"attributes": {
"user_name": "Cameron",
"password": "8EqcGL2tsQngWe",
"port": "8443",
"host": "fw04-mh1.maxi.host",
"region": {
"city": "São Paulo 277",
"country": "Brazil 290",
"site": {
"id": "loc_VE1Wd3wQdXnZJ",
"name": "São Paulo 277",
"slug": "SAO",
"facility": "São Paulo 277"
}
},
"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": {}
}Creates a new VPN Session.
NOTE: The VPN credentials are only listed ONCE upon creation. They can however be refreshed or deleted.
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.vpn_sessions.create(data={
"attributes": {
"site": latitudesh_python_sdk.PostVpnSessionVpnSessionsSite.SAO,
"server_id": "sv_LMmAD8wyqwop2",
},
})
# Handle response
print(res){
"data": {
"id": "vpn_VLMmAD8EOwop2",
"type": "vpn_sessions",
"attributes": {
"user_name": "Cameron",
"password": "8EqcGL2tsQngWe",
"port": "8443",
"host": "fw04-mh1.maxi.host",
"region": {
"city": "São Paulo 277",
"country": "Brazil 290",
"site": {
"id": "loc_VE1Wd3wQdXnZJ",
"name": "São Paulo 277",
"slug": "SAO",
"facility": "São Paulo 277"
}
},
"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?