Skip to main content
PATCH
/
user
/
profile
/
{id}
Go (SDK)
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": {}
}

Authorizations

Authorization
string
header
required

Path Parameters

id
string
required

Body

data
object
required

Response

200 - application/vnd.api+json

Success

data
object