Authorizations
Path Parameters
Body
Response
200 - application/vnd.api+json
Success
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.UserProfile.Update(ctx, "user_lGJBgAxbgeUJ4yZj56wmfrK4vag", operations.PatchUserProfileUserProfileRequestBody{
Data: operations.PatchUserProfileUserProfileData{
ID: "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
Type: operations.PatchUserProfileUserProfileTypeUsers,
Attributes: &operations.PatchUserProfileUserProfileAttributes{
Role: operations.PatchUserProfileUserProfileRoleCollaborator.ToPointer(),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"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
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.UserProfile.Update(ctx, "user_lGJBgAxbgeUJ4yZj56wmfrK4vag", operations.PatchUserProfileUserProfileRequestBody{
Data: operations.PatchUserProfileUserProfileData{
ID: "user_lGJBgAxbgeUJ4yZj56wmfrK4vag",
Type: operations.PatchUserProfileUserProfileTypeUsers,
Attributes: &operations.PatchUserProfileUserProfileAttributes{
Role: operations.PatchUserProfileUserProfileRoleCollaborator.ToPointer(),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"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
Show child attributes
Was this page helpful?