import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.userProfile.update({
id: "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
requestBody: {
data: {
id: "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
type: "users",
attributes: {
role: "collaborator",
},
},
},
});
console.log(result);
}
run();{
"data": {
"id": "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
"type": "users",
"attributes": {
"first_name": "Tamesha",
"last_name": "Barton",
"email": "[email protected]",
"role": "owner",
"created_at": null,
"updated_at": null
}
},
"meta": {}
}Update the current user profile
import { Latitudesh } from "latitudesh-typescript-sdk";
const latitudesh = new Latitudesh({
bearer: process.env["LATITUDESH_BEARER"] ?? "",
});
async function run() {
const result = await latitudesh.userProfile.update({
id: "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
requestBody: {
data: {
id: "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
type: "users",
attributes: {
role: "collaborator",
},
},
},
});
console.log(result);
}
run();{
"data": {
"id": "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
"type": "users",
"attributes": {
"first_name": "Tamesha",
"last_name": "Barton",
"email": "[email protected]",
"role": "owner",
"created_at": null,
"updated_at": null
}
},
"meta": {}
}Show child attributes
Success
Was this page helpful?