Skip to content
DunSocial Docs

Members and invites

Invite teammates, change roles, and manage seats.

Team routes live under /api/workspaces/:id/team/*. Send Authorization and be a member of that workspace.

List members

GET /api/workspaces/:id/members
GET /api/workspaces/:id/team/members

Your role

GET /api/workspaces/:id/team/role"owner" | "admin" | "member"

Team stats

GET /api/workspaces/:id/team/stats — member counts, seat limit, and whether you can invite.

Invite someone

POST /api/workspaces/:id/team/invitations

curl -X POST https://api.dunsocial.com/api/workspaces/WORKSPACE_ID/team/invitations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"email":"teammate@example.com","role":"member"}'

role is "admin" or "member". Seat limits and existing memberships return 400. Only admins and owners can invite (403 otherwise).

Method Path Notes
GET .../team/invitations Pending invites (empty if you are not admin/owner)
POST .../team/invitations/resend { email, role }
DELETE .../team/invitations/:invitationId Cancel

Accept or reject an invite

These use only the bearer token (no workspace header):

Method Path
POST /api/workspaces/invitations/:invitationId/accept
POST /api/workspaces/invitations/:invitationId/reject

Wrong email → 403. Expired invite → 400.

Manage members

Method Path Who
DELETE .../team/members/:memberId Admin/owner (with role rules)
POST .../team/members/:memberId/suspend Admin/owner
POST .../team/members/:memberId/unsuspend Admin/owner
PATCH .../team/members/:memberId/role Owner only — { role: "admin" | "member" }