roboto.domain.orgs.org_invite
Module Contents
OrgInvite
An invitation to join an organization from one user to another.
Organization invitations allow existing members to invite new users to join their organization. Invitations are created by calling Org.invite_user() and can be accepted or declined by the invited user.
Invitations cannot be created directly through the constructor - they must be created through the organization’s invite_user method.
Parameters
roboto_client Optional[roboto.OrgInvite.accept()
Accept this invitation and join the organization.
The invited user becomes a member of the organization with default user role permissions.
Raises
The caller is not the invited user.
The invitation has already been accepted or declined.
Return type
Usage
Accept an invitation:
from roboto import OrgInvite
invite = OrgInvite.from_id("invite_12345")
invite.accept() # Join the organizationOrgInvite.create()
Create a new organization invitation.
Creates an invitation for the specified user to join the organization. This method is typically called internally by Org.invite_user().
Parameters
invited_user_id strUnique identifier for the user to invite.
org_id strUnique identifier for the organization.
roboto_client Optional[roboto.Optional Roboto client instance. If not provided, uses the default client.
Returns
A new OrgInvite instance representing the created invitation.
Raises
The user or organization does not exist.
The user is already a member or has a pending invite.
The caller lacks permission to invite users.
Usage
Create an invitation (typically done via Org.invite_user):
from roboto import OrgInvite
invite = OrgInvite.create("alice@example.com", "org_12345")OrgInvite.decline()
Decline this invitation and do not join the organization.
The invitation is marked as declined and cannot be accepted later.
Raises
The caller is not the invited user.
The invitation has already been accepted or declined.
Return type
Usage
Decline an invitation:
from roboto import OrgInvite
invite = OrgInvite.from_id("invite_12345")
invite.decline() # Do not join the organizationOrgInvite.for_org()
Retrieve all pending invitations for an organization.
Parameters
org_id strUnique identifier for the organization.
roboto_client Optional[roboto.Optional Roboto client instance. If not provided, uses the default client.
Returns
Collection of OrgInvite instances for pending invitations.
Raises
The organization does not exist.
The caller lacks permission to view invitations.
Usage
List all invitations for an organization:
from roboto import OrgInvite
invites = OrgInvite.for_org("org_12345")
for invite in invites:
print(f"Pending invite for: {invite.invited_user_id}")OrgInvite.from_id()
Load an existing invitation by its unique ID.
Parameters
invite_id strUnique identifier for the invitation to retrieve.
roboto_client Optional[roboto.Optional Roboto client instance. If not provided, uses the default client.
Returns
OrgInvite instance for the specified invitation ID.
Raises
No invitation exists with the specified ID.
The caller is not authorized to access this invitation.
Usage
Load an invitation by ID:
from roboto import OrgInvite
invite = OrgInvite.from_id("invite_12345")
print(f"Invited user: {invite.invited_user_id}")Properties
OrgInvite.invite_id
Unique identifier for this invitation.
Returns
The invitation’s unique ID.
OrgInvite.invited_by_user_id
User ID of the person who created this invitation.
Returns
The unique identifier of the user who sent the invitation.
OrgInvite.invited_user_id
User ID of the person who was invited.
Returns
The unique identifier of the invited user.
OrgInvite.org_id
Organization ID for the organization this invitation is for.
Returns
The unique identifier of the organization.
OrgInvite.to_dict()
Convert this invitation to a dictionary representation.
Returns a JSON-serializable dictionary containing all invitation data.
Returns
Dictionary representation of the invitation.
Usage
Export invitation data:
from roboto import OrgInvite
invite = OrgInvite.from_id("invite_12345")
invite_data = invite.to_dict()
print(f"Invited user: {invite_data.get('user_id')}")