Skip to main content
POST
/
team
/
members
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.TeamMembers.PostTeamMembers(ctx, operations.PostTeamMembersTeamMembersRequestBody{
        Data: operations.PostTeamMembersTeamMembersData{
            Type: operations.PostTeamMembersTeamMembersTypeMemberships,
            Attributes: &operations.PostTeamMembersTeamMembersAttributes{
                FirstName: latitudeshgosdk.Pointer("Bernard"),
                LastName: latitudeshgosdk.Pointer("Cremin"),
                Email: "[email protected]",
                Role: operations.PostTeamMembersRoleCollaborator,
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.Membership != nil {
        // handle response
    }
}
{
  "data": {
    "id": "user_pbV0Dgykd4AWz",
    "type": "memberships",
    "attributes": {
      "first_name": "Bernard",
      "last_name": "Cremin",
      "email": "[email protected]",
      "role": "collaborator",
      "mfa_enabled": false,
      "created_at": "2025-07-16T18:36:32+00:00",
      "updated_at": "2025-07-16T18:36:32+00:00"
    }
  },
  "meta": {}
}

Authorizations

Authorization
string
header
required

Body

data
object
required

Response

201 - application/vnd.api+json

Created

data
object