Invitations
Create, accept, and manage organization invitations.
Get an invitation by ID
/organizations/{organizationId}/invitations/{invitationId}Retrieves a single invitation by its ID within an organization. Returns the invitation object including invitee email, assigned role, status (pending, accepted, expired), creator, and timestamps. The 'invitationId' param is the invitation UUID. Returns 404 if the invitation does not exist.
import osfrom giantcontext import GiantContext
gc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])
orgs = gc.me.list_my_organizations()org_id = orgs.items[0].id
invitation = gc.invitations.get_organization_invitation( organization_id=org_id, invitation_id="inv_123")
List invitations sent by an organization: pending, accepted and expired, with role
/organizations/{organizationId}/invitationsReturns a paginated list of pending, accepted, and expired invitations for an organization. Each invitation includes the invitee email, assigned role, status, creation date, and expiration. Supports search by email, filtering by status, and sorting. Requires owner or admin role within the organization.
import osfrom giantcontext import GiantContext
gc = GiantContext(api_key=os.environ["GIANTCONTEXT_API_KEY"])
orgs = gc.me.list_my_organizations()org_id = orgs.items[0].id
invitations = gc.invitations.list_organization_invitations(organization_id=org_id)