Skip to content
API Reference

Accept

client.Invitations.Accept(ctx, token, body) (*InvitationAcceptResponse, error)
POST/invitations/{token}/accept

Accept and consume an invitation token to join the organization

ParametersExpand Collapse
token string
minLength1
maxLength500
body InvitationAcceptParams
XClientRequestID param.Field[string]optional

Unique request identifier specified by the originating caller and passed along by proxies.

formatuuid
ReturnsExpand Collapse
type InvitationAcceptResponse struct{…}

Result of accepting an invitation

OrganizationID string

ID of the organization joined

minLength1
maxLength255
OrganizationName string

Name of the organization joined

Success bool

Whether the invitation was successfully accepted

UserID stringoptional

ID of the user who accepted the invitation

minLength1
maxLength255

Accept

package main

import (
  "context"
  "fmt"

  "github.com/keycardai/keycard-go"
)

func main() {
  client := keycard.NewClient(

  )
  response, err := client.Invitations.Accept(
    context.TODO(),
    "token",
    keycard.InvitationAcceptParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.OrganizationID)
}
{
  "organization_id": "ab3def8hij2klm9opq5rst7uvw",
  "organization_name": "organization_name",
  "success": true,
  "user_id": "ab3def8hij2klm9opq5rst7uvw"
}
Returns Examples
{
  "organization_id": "ab3def8hij2klm9opq5rst7uvw",
  "organization_name": "organization_name",
  "success": true,
  "user_id": "ab3def8hij2klm9opq5rst7uvw"
}