Create
client.Organizations.Invitations.New(ctx, organizationID, params) (*Invitation, error)
POST/organizations/{organization_id}/invitations
Create an invitation to join an organization
Parameters
organizationID string
Organization ID or label identifier
minLength1
maxLength255
Returns
Create
package main
import (
"context"
"fmt"
"github.com/keycardai/keycard-go"
)
func main() {
client := keycard.NewClient(
)
invitation, err := client.Organizations.Invitations.New(
context.TODO(),
"x",
keycard.OrganizationInvitationNewParams{
Email: "dev@stainless.com",
Role: keycard.OrganizationRoleOrgAdmin,
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", invitation.ID)
}
{
"id": "ab3def8hij2klm9opq5rst7uvw",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "ab3def8hij2klm9opq5rst7uvw",
"email": "dev@stainless.com",
"expires_at": "2019-12-27T18:11:19.117Z",
"organization_id": "ab3def8hij2klm9opq5rst7uvw",
"role": "org_admin",
"status": "pending",
"updated_at": "2019-12-27T18:11:19.117Z",
"permissions": {
"organizations": {
"read": true,
"update": true
},
"users": {
"read": true,
"list": true
}
}
}Returns Examples
{
"id": "ab3def8hij2klm9opq5rst7uvw",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "ab3def8hij2klm9opq5rst7uvw",
"email": "dev@stainless.com",
"expires_at": "2019-12-27T18:11:19.117Z",
"organization_id": "ab3def8hij2klm9opq5rst7uvw",
"role": "org_admin",
"status": "pending",
"updated_at": "2019-12-27T18:11:19.117Z",
"permissions": {
"organizations": {
"read": true,
"update": true
},
"users": {
"read": true,
"list": true
}
}
}