Skip to main content

Teams

Teams let multiple users collaborate on links and analytics. Team management is an account operation, so these endpoints require a JWT (not an API key). Seat limits depend on your subscription tier (Free 1, Pro 5, Business 25, Enterprise unlimited).

Roles (RBAC)​

Members have one of four roles, in ascending privilege:

RoleCan
viewerRead team resources and members
memberEverything a viewer can, plus act within the team
adminInvite/remove members, manage invites and roles
ownerEverything, including managing admins. Assigned to the team creator

The invite and role-change endpoints accept only admin, member, or viewer — owner is fixed to the creator. Promoting or demoting an admin is owner-only.

Create a team​

curl -X POST https://api.short.leonai.io/api/v1/teams \
-H "Authorization: Bearer <jwt>" \
-H "Content-Type: application/json" \
-d '{ "name": "Growth" }'

REST: POST /api/v1/teams

List your teams​

curl https://api.short.leonai.io/api/v1/teams \
-H "Authorization: Bearer <jwt>"

Members and invites​

ActionEndpoint
List membersGET /api/v1/teams/:teamId/members
Invite a memberPOST /api/v1/teams/:teamId/invites
List pending invitesGET /api/v1/teams/:teamId/invites
Revoke an inviteDELETE /api/v1/teams/:teamId/invites/:inviteId
Accept an invitePOST /api/v1/teams/invites/accept
Remove a memberDELETE /api/v1/teams/:teamId/members/:memberId
Change a member's rolePATCH /api/v1/teams/:teamId/members/:memberId

Invite a member​

curl -X POST https://api.short.leonai.io/api/v1/teams/<teamId>/invites \
-H "Authorization: Bearer <jwt>" \
-H "Content-Type: application/json" \
-d '{ "email": "teammate@example.com", "role": "member" }'

The invitee receives an invite they accept with the invite token. Once accepted, they appear in the team's member list and can act within the team's permissions.

Exact request/response shapes

Team endpoints are documented at a high level here. See the full API reference for exact field names, roles, and response bodies under the Teams tag.