Manage members
Invite people to an Organization, change their roles, and deactivate members.
Add people to your Organization with an email invitation, and give each one the Organization role that matches their work. Membership lets a person sign in, but it does not let them see any Project's data, so you also grant them a Project role.
Prerequisites
- You have the Organization
ownerrole. Only owners can invite, list, and manage members. - You signed in to the Organization that you manage. See Sign in.
Invite a member
Send an invitation to an email address. The invitation expires after seven days unless you set another value.
request = OrganizationInviteMemberRequest(email="teammate@example.com", role="member", expires_in_days=7)
invitation = client.organization.invite_member(request)
print(f"sent invitation {invitation.invitation_id}")The role value is guest, member, or owner. See
Organization roles.
The person becomes a member when they accept the invitation.
Manage pending invitations
List the Organization's invitations, then send one again or revoke it:
curl https://api.spiraldb.dev/v1/organizations/invitations \
-H "Authorization: Bearer $SPIRAL_TOKEN"
curl -X POST https://api.spiraldb.dev/v1/organizations/invitations/$INVITE_ID/resend \
-H "Authorization: Bearer $SPIRAL_TOKEN"
curl -X POST https://api.spiraldb.dev/v1/organizations/invitations/$INVITE_ID/revoke \
-H "Authorization: Bearer $SPIRAL_TOKEN"List members
for member in client.organization.list_members_items(page_size=50):
print(f"{member.email} ({member.role}, {member.auth_method}) last signed in {member.last_sign_in_at}")Change a role
Set a new Organization role for a member:
curl -X PUT https://api.spiraldb.dev/v1/organizations/users/$USER_ID/role \
-H "Authorization: Bearer $SPIRAL_TOKEN" \
-H "Content-Type: application/json" \
-d '{"role": "owner"}'The API rejects a change that removes the last owner. Promote another
member first.
Deactivate a member
Deactivate a member who leaves the team. Deactivation ends their sessions in the Organization and stops them from signing in to it again.
curl -X POST https://api.spiraldb.dev/v1/organizations/users/$USER_ID/deactivate \
-H "Authorization: Bearer $SPIRAL_TOKEN"Their Project grants stay in place. They cannot use them while they cannot sign in, but revoke them too if you want each Project's grant list to match who is actually on the team. See Revoke a grant.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
| A permission error | Your role in the active Organization is not owner. | Ask an owner to change your role, or switch to the correct Organization. |
cannot demote the last owner or cannot deactivate the last owner | The change removes the last owner. | Make another member an owner first. |
Where next: grant Project access to the new member.