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.UserProfile.ListTeams(ctx)
if err != nil {
log.Fatal(err)
}
if res.UserTeams != nil {
// handle response
}
}{
"data": [
{
"id": "team_mQvE9R9E7ofrQVaZXn0zcWWjzZWe",
"type": "teams",
"attributes": {
"name": "653 Team",
"slug": "653-team",
"address": "Suite 853 20535 Teofila Plain, Wizaberg, NH 82567",
"currency": "BRL",
"created_at": "2025-10-22T01:03:28+00:00",
"updated_at": "2025-10-27T01:03:28+00:00",
"status": "verified",
"enforce_mfa": false,
"users": [
{
"id": "user_MJv1LkyeKzt5Aa7lEjj9hVVo049Z",
"first_name": "Lucio",
"last_name": "Veum",
"email": "[email protected]",
"created_at": "2025-04-17T00:00:00.000Z",
"updated_at": "2025-05-03T00:00:00.000Z",
"role": {
"id": "role_Yy4yoXz1lwFoeyw4407BTYZo4xV",
"name": "owner",
"created_at": "2025-08-31T00:00:00.000Z",
"updated_at": "2026-05-27T00:00:00.000Z"
}
}
],
"projects": [],
"owner": {
"id": "user_MJv1LkyeKzt5Aa7lEjj9hVVo049Z",
"first_name": "Lucio",
"last_name": "Veum",
"email": "[email protected]",
"created_at": "2025-04-17T00:00:00.000Z",
"updated_at": "2025-05-03T00:00:00.000Z",
"role": {
"id": "role_Yy4yoXz1lwFoeyw4407BTYZo4xV",
"name": "owner",
"created_at": "2025-08-31T00:00:00.000Z",
"updated_at": "2026-05-27T00:00:00.000Z"
}
},
"billing": {
"id": "bill_mw49QDB5qagKb",
"customer_billing_id": "cus_hxy4ysqu81nnjc"
},
"feature_flags": [],
"limits": {
"bare_metal": 5,
"bare_metal_gpu": 1,
"virtual_machine": null,
"virtual_machine_gpu": 0,
"database": null,
"filesystem": null,
"block_storage": null
}
}
}
],
"meta": {}
}Returns a list of all teams the user belongs to
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.UserProfile.ListTeams(ctx)
if err != nil {
log.Fatal(err)
}
if res.UserTeams != nil {
// handle response
}
}{
"data": [
{
"id": "team_mQvE9R9E7ofrQVaZXn0zcWWjzZWe",
"type": "teams",
"attributes": {
"name": "653 Team",
"slug": "653-team",
"address": "Suite 853 20535 Teofila Plain, Wizaberg, NH 82567",
"currency": "BRL",
"created_at": "2025-10-22T01:03:28+00:00",
"updated_at": "2025-10-27T01:03:28+00:00",
"status": "verified",
"enforce_mfa": false,
"users": [
{
"id": "user_MJv1LkyeKzt5Aa7lEjj9hVVo049Z",
"first_name": "Lucio",
"last_name": "Veum",
"email": "[email protected]",
"created_at": "2025-04-17T00:00:00.000Z",
"updated_at": "2025-05-03T00:00:00.000Z",
"role": {
"id": "role_Yy4yoXz1lwFoeyw4407BTYZo4xV",
"name": "owner",
"created_at": "2025-08-31T00:00:00.000Z",
"updated_at": "2026-05-27T00:00:00.000Z"
}
}
],
"projects": [],
"owner": {
"id": "user_MJv1LkyeKzt5Aa7lEjj9hVVo049Z",
"first_name": "Lucio",
"last_name": "Veum",
"email": "[email protected]",
"created_at": "2025-04-17T00:00:00.000Z",
"updated_at": "2025-05-03T00:00:00.000Z",
"role": {
"id": "role_Yy4yoXz1lwFoeyw4407BTYZo4xV",
"name": "owner",
"created_at": "2025-08-31T00:00:00.000Z",
"updated_at": "2026-05-27T00:00:00.000Z"
}
},
"billing": {
"id": "bill_mw49QDB5qagKb",
"customer_billing_id": "cus_hxy4ysqu81nnjc"
},
"feature_flags": [],
"limits": {
"bare_metal": 5,
"bare_metal_gpu": 1,
"virtual_machine": null,
"virtual_machine_gpu": 0,
"database": null,
"filesystem": null,
"block_storage": null
}
}
}
],
"meta": {}
}Was this page helpful?