HyperSaaS
BackendWorkspaces & Teams

Invitations

Invite users to workspaces and teams via email.

Invitation Model

class Invitation(BaseModel):
    workspace = models.ForeignKey(Workspace, null=True, blank=True)
    team = models.ForeignKey(Team, null=True, blank=True)
    inviter = models.ForeignKey(User, related_name="sent_invitations")
    invitee = models.ForeignKey(User, null=True, blank=True, related_name="received_invitations")
    email = models.EmailField()
    role = models.CharField(choices=ROLE_CHOICES, default="member")
    is_accepted = models.BooleanField(default=False)

An invitation targets either a workspace or a team (not both). If the invitee doesn't have an account yet, only the email field is populated.

API Endpoints

MethodEndpointDescription
GET/api/invitations/List invitations
POST/api/invitations/Create invitation
GET/api/invitations/{id}/Retrieve invitation
DELETE/api/invitations/{id}/Cancel invitation
POST/api/invitations/{id}/accept/Accept invitation
POST/api/invitations/{id}/resend/Resend invitation email

Send Invitation

POST /api/invitations/
{
  "email": "colleague@example.com",
  "workspace": "workspace-uuid",
  "role": "member"
}

Accept Invitation

POST /api/invitations/{id}/accept/

Creates a WorkspaceMembership (or TeamMembership) and marks the invitation as accepted.

On this page