Teams API
Manage your team and members programmatically.
Endpoints Overview
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/teams | Create a new team |
| GET | /api/teams | Get all teams for current user |
| GET | /api/teams/:id | Get team by ID |
| PUT | /api/teams/:id | Update team settings |
| DELETE | /api/teams/:id | Delete team |
| GET | /api/teams/members | List team members |
| POST | /api/teams/members/invite | Invite new member |
| DELETE | /api/teams/members/:id | Remove member |
| PATCH | /api/teams/members/:id/role | Update member role |
| GET | /api/teams/invitations/my | Get my pending invitations |
| POST | /api/teams/invitations/:id/accept | Accept invitation |
| POST | /api/teams/invitations/:id/reject | Reject invitation |
| DELETE | /api/teams/members/:id/invitation | Cancel invitation |
| GET | /api/teams/activity | Get team activity |
All team endpoints require JWT authentication.
Create Team
POST /api/teams
Create a new team with the authenticated user as owner.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Team name |
slug | string | No | URL-friendly team identifier |
Response
{
"id": "team_abc123",
"name": "Acme Corporation",
"slug": "acme-corp",
"createdAt": "2024-06-01T00:00:00Z"
}
Get User Teams
GET /api/teams
Get all teams where the user is an owner or member, including their personal team.
Response
{
"data": [
{
"id": "team_abc123",
"name": "Acme Corporation",
"slug": "acme-corp",
"isPersonal": false,
"role": "owner",
"memberCount": 5,
"createdAt": "2024-06-01T00:00:00Z"
}
]
}
Example
curl https://api.renderdoc.dev/api/teams \
-H "Authorization: Bearer <jwt_token>"
Get Team by ID
GET /api/teams/:id
Get details about a specific team.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Team ID |
Response
{
"id": "team_abc123",
"name": "Acme Corporation",
"slug": "acme-corp",
"memberCount": 5,
"createdAt": "2024-06-01T00:00:00Z"
}
Update Team
PUT /api/teams/:id
Update team settings. Only team owner can update.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Team ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Team name |
Response
Returns the updated team object.
Example
curl -X PUT https://api.renderdoc.dev/api/teams/team_abc123 \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corporation Updated"
}'
Delete Team
DELETE /api/teams/:id
Soft delete a team. Only team owner can delete.
Personal teams cannot be deleted via API - they are automatically deleted when the user account is deleted.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Team ID |
Response
{
"message": "Team deleted successfully"
}
List Team Members
GET /api/teams/members
Get all members of the current user's team.
Response
{
"data": [
{
"id": "user_abc123",
"email": "[email protected]",
"name": "John Doe",
"role": "owner",
"joinedAt": "2024-06-01T00:00:00Z"
},
{
"id": "user_def456",
"email": "[email protected]",
"name": "Jane Smith",
"role": "admin",
"joinedAt": "2024-07-15T00:00:00Z"
}
]
}
Member Roles
| Role | Description |
|---|---|
owner | Full access, can delete team |
admin | Full access except team deletion |
member | Can create and use templates |
viewer | Read-only access |
Example
curl https://api.renderdoc.dev/api/teams/members \
-H "Authorization: Bearer <jwt_token>"
Invite Member
POST /api/teams/members/invite
Send an invitation to join your team.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address to invite |
role | string | No | Role to assign (default: member) |
Request Example
{
"email": "[email protected]",
"role": "member"
}
Response
{
"id": "invite_abc123",
"email": "[email protected]",
"role": "member",
"status": "pending",
"expiresAt": "2025-01-22T00:00:00Z"
}
Remove Member
DELETE /api/teams/members/:id
Remove a member from your team. Only team owner can remove members.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Member user ID |
Response
{
"message": "Member removed successfully"
}
Update Member Role
PATCH /api/teams/members/:id/role
Change a member's role. Only team owner can update roles.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Member user ID |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
role | string | Yes | New role: admin, member, or viewer |
Response
Returns the updated member object.
Example
curl -X PATCH https://api.renderdoc.dev/api/teams/members/user_def456/role \
-H "Authorization: Bearer <jwt_token>" \
-H "Content-Type: application/json" \
-d '{
"role": "admin"
}'
Get My Invitations
GET /api/teams/invitations/my
Get all pending team invitations for the current user.
Response
{
"data": [
{
"id": "invite_abc123",
"teamId": "team_xyz789",
"teamName": "Acme Corporation",
"role": "member",
"invitedBy": "[email protected]",
"expiresAt": "2025-01-22T00:00:00Z"
}
]
}
Accept Invitation
POST /api/teams/invitations/:id/accept
Accept a pending team invitation.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Invitation ID |
Response
{
"message": "Invitation accepted successfully"
}
Reject Invitation
POST /api/teams/invitations/:id/reject
Reject a pending team invitation.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Invitation ID |
Response
{
"message": "Invitation rejected successfully"
}
Cancel Invitation
DELETE /api/teams/members/:id/invitation
Cancel a pending invitation. Only team owner can cancel.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Invitation ID |
Response
{
"message": "Invitation cancelled successfully"
}
Get Team Activity
GET /api/teams/activity
Get recent activity for the current user's team.
Response
{
"data": [
{
"type": "member_joined",
"user": "Jane Smith",
"timestamp": "2024-07-15T00:00:00Z"
},
{
"type": "template_created",
"template": "Invoice Template",
"user": "John Doe",
"timestamp": "2024-06-15T00:00:00Z"
}
]
}
Error Codes
| Code | Description |
|---|---|
ERR_TEAM_001 | Team not found |
ERR_TEAM_002 | A team with this slug already exists |
ERR_TEAM_003 | You are not the owner of this team |
ERR_TEAM_004 | Personal teams cannot be deleted directly |
ERR_TEAM_005 | Personal team slug cannot be changed |
ERR_TEAM_006 | This team is not a personal team |
ERR_TEAM_007 | User is already a member of this team |
ERR_TEAM_008 | An invitation has already been sent to this user |
ERR_TEAM_009 | Invitation not found |
ERR_TEAM_010 | This invitation has expired |
ERR_TEAM_011 | Team member not found |
ERR_TEAM_012 | You cannot remove yourself from the team |
Related: Team Management | Users API