Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.user_data.post_user_data(data={
"type": latitudesh_python_sdk.PostUserDataUserDataType.USER_DATA,
"attributes": {
"description": "User Data description",
"project": "proj_QraYDPW3qpjwW",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
})
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.UserData.CreateNew(ctx, operations.PostUserDataUserDataRequestBody{
Data: operations.PostUserDataUserDataData{
Type: operations.PostUserDataUserDataTypeUserData,
Attributes: &operations.PostUserDataUserDataAttributes{
Description: "User Data description",
Project: latitudeshgosdk.Pointer("proj_QraYDPW3qpjwW"),
Content: "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
},
})
if err != nil {
log.Fatal(err)
}
if res.UserDataObject != 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.userData.createNew({
data: {
type: "user_data",
attributes: {
description: "User Data description",
project: "proj_QraYDPW3qpjwW",
content: "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/user_data \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "user_data",
"attributes": {
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
"description": "User Data description",
"project": "proj_QraYDPW3qpjwW"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'user_data',
attributes: {
content: 'I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd',
description: 'User Data description',
project: 'proj_QraYDPW3qpjwW'
}
}
})
};
fetch('https://api.latitude.sh/user_data', 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/user_data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'user_data',
'attributes' => [
'content' => 'I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd',
'description' => 'User Data description',
'project' => 'proj_QraYDPW3qpjwW'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/user_data")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"user_data\",\n \"attributes\": {\n \"content\": \"I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd\",\n \"description\": \"User Data description\",\n \"project\": \"proj_QraYDPW3qpjwW\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/user_data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"user_data\",\n \"attributes\": {\n \"content\": \"I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd\",\n \"description\": \"User Data description\",\n \"project\": \"proj_QraYDPW3qpjwW\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ud_w49QDB55qagKb",
"type": "user_data",
"attributes": {
"description": "User Data description",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
"created_at": "2026-01-14T15:57:11+00:00",
"updated_at": "2026-01-14T15:57:11+00:00",
"decoded_content": "#cloud-config\nruncmd:\n - [ touch, /home/ubuntu/test ]",
"project": {
"id": "proj_QraYDPW3qpjwW",
"name": "Rustic Granite Gloves",
"slug": "rustic-granite-gloves",
"description": "Heavy Duty Leather Wallet",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
}
}
},
"meta": {}
}User data
Create user data
Allows you to create User Data in a team, which can be used to perform custom setup on your servers after deploy and reinstall.
POST
/
user_data
Python (SDK)
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.user_data.post_user_data(data={
"type": latitudesh_python_sdk.PostUserDataUserDataType.USER_DATA,
"attributes": {
"description": "User Data description",
"project": "proj_QraYDPW3qpjwW",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
})
# Handle response
print(res)package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.UserData.CreateNew(ctx, operations.PostUserDataUserDataRequestBody{
Data: operations.PostUserDataUserDataData{
Type: operations.PostUserDataUserDataTypeUserData,
Attributes: &operations.PostUserDataUserDataAttributes{
Description: "User Data description",
Project: latitudeshgosdk.Pointer("proj_QraYDPW3qpjwW"),
Content: "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
},
})
if err != nil {
log.Fatal(err)
}
if res.UserDataObject != 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.userData.createNew({
data: {
type: "user_data",
attributes: {
description: "User Data description",
project: "proj_QraYDPW3qpjwW",
content: "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
},
},
});
console.log(result);
}
run();curl --request POST \
--url https://api.latitude.sh/user_data \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"data": {
"type": "user_data",
"attributes": {
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
"description": "User Data description",
"project": "proj_QraYDPW3qpjwW"
}
}
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
type: 'user_data',
attributes: {
content: 'I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd',
description: 'User Data description',
project: 'proj_QraYDPW3qpjwW'
}
}
})
};
fetch('https://api.latitude.sh/user_data', 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/user_data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'user_data',
'attributes' => [
'content' => 'I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd',
'description' => 'User Data description',
'project' => 'proj_QraYDPW3qpjwW'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.latitude.sh/user_data")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"type\": \"user_data\",\n \"attributes\": {\n \"content\": \"I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd\",\n \"description\": \"User Data description\",\n \"project\": \"proj_QraYDPW3qpjwW\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.latitude.sh/user_data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"type\": \"user_data\",\n \"attributes\": {\n \"content\": \"I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd\",\n \"description\": \"User Data description\",\n \"project\": \"proj_QraYDPW3qpjwW\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "ud_w49QDB55qagKb",
"type": "user_data",
"attributes": {
"description": "User Data description",
"content": "I2Nsb3VkLWNvbmZpZwpydW5jbWQ6CiAtIFsgdG91Y2gsICAvaG9tZS91YnVudHUvdGVzdCBd",
"created_at": "2026-01-14T15:57:11+00:00",
"updated_at": "2026-01-14T15:57:11+00:00",
"decoded_content": "#cloud-config\nruncmd:\n - [ touch, /home/ubuntu/test ]",
"project": {
"id": "proj_QraYDPW3qpjwW",
"name": "Rustic Granite Gloves",
"slug": "rustic-granite-gloves",
"description": "Heavy Duty Leather Wallet",
"provisioning_type": "on_demand",
"billing_type": "Normal",
"billing_method": "Normal",
"bandwidth_alert": false,
"environment": null,
"billing": {},
"stats": {
"databases": 0,
"ip_addresses": 0,
"prefixes": 0,
"servers": 0,
"storages": 0,
"virtual_machines": 0,
"vlans": 0
}
}
}
},
"meta": {}
}Was this page helpful?
⌘I