Intercode SaaS Kit
  • Welcome to SaaS Starter Kit
  • Getting Started
    • Technology stack
    • Database Setup
    • Local Environment Setup
  • Basics
    • Dependencies
    • App architecture
    • Deployment
    • App roles
    • Endpoints List
      • Auth
      • Two Factor Auth
      • Businesses
      • Demo
      • Email
      • Export Document
      • Email Files
      • Files Demo
      • Leads
      • Orders
      • Payments
      • Subscriptions
      • Teams
      • Team Memberships
      • User Admin
  • Animation and Styles
    • Framer Motion
    • Ant Design and Styles
  • Pages
    • Auth
      • Working with PassportJS
      • Two-Factor Auth
      • OAuth Providers
    • Leads
    • Businesses
    • Team management
      • Ownership
    • Profile
    • User Settings
      • App Tour
    • App Settings
      • Lead Statuses
    • Dashboard
      • Lead volume widget
      • Doughnut chart widget
      • Recent leads table widget
      • Lead count over period widget
    • Demo
  • Features
    • Impersonation
    • Subscriptions (Stripe)
    • Search
    • Sentry
    • Captcha
    • Audit Logs
    • Internationalization
  • External integrations
    • Mailer
    • Google oAuth2
    • Facebook oAuth2
    • S3 compatible storage (AWS, MinIO)
Powered by GitBook
On this page
  1. Basics
  2. Endpoints List

Teams

PreviousSubscriptionsNextTeam Memberships

Last updated 6 months ago

GET

POST

PUT

DELETE

Retrieves information about the authenticated user's team.

get
Responses
200
Team information retrieved successfully
application/json
403
Access denied
application/json
404
Team not found
application/json
get
GET /teams HTTP/1.1
Host: 
Accept: */*
{
  "usersLimit": 5,
  "name": "Team Name",
  "count": 10
}

Retrieves members of the authenticated user's team.

get
Responses
200
Team members retrieved successfully
application/json
403
Access denied
application/json
get
GET /teams/members HTTP/1.1
Host: 
Accept: */*
[
  {
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "phone": "123-456-7890",
    "role": "Member",
    "isActive": true,
    "invitationAccepted": true
  }
]

Retrieves available team roles.

get
Responses
200
Team roles retrieved successfully
application/json
get
GET /teams/roles HTTP/1.1
Host: 
Accept: */*
200

Team roles retrieved successfully

[
  {
    "label": "Member",
    "value": "Member"
  }
]

Checks the team limit for the authenticated user.

get
Responses
200
Team limit checked successfully
application/json
ResponsebooleanExample: true
500
Internal server error
application/json
get
GET /teams/limit HTTP/1.1
Host: 
Accept: */*
true

Retrieves all teams based on the provided parameters.

get
Query parameters
offsetnumberOptional

The number of records to skip.

Example: 0
limitnumberOptional

The maximum number of records to return.

Example: 10
globalSearchstringOptional

The global search term to use for finding teams.

Example: Team Name
Responses
200
Teams retrieved successfully
application/json
500
Internal server error
application/json
get
GET /teams/all HTTP/1.1
Host: 
Accept: */*
[
  {
    "id": "team_id",
    "name": "Team Name",
    "usersLimit": 5,
    "membersCount": 10,
    "owner": {
      "id": 1,
      "firstName": "John",
      "lastName": "Doe",
      "email": "owner@example.com"
    },
    "subscription": "Basic",
    "isImpersonationEnabled": true
  }
]

Accepts an invitation to join a team.

put
Path parameters
idstringRequired

The ID of the team to accept the invitation for.

Example: team_id
Responses
200
Invitation accepted successfully
application/json
ResponseanyExample: {"message":"Invitation accepted successfully","description":"You have accepted the invitation successfully."}
400
Membership not found
application/json
500
Internal server error
application/json
put
PUT /teams/accept-invitation/{id} HTTP/1.1
Host: 
Accept: */*
{
  "message": "Invitation accepted successfully",
  "description": "You have accepted the invitation successfully."
}

Declines an invitation to join a team.

put
Path parameters
idstringRequired

The ID of the team to decline the invitation for.

Example: team_id
Responses
200
Invitation declined successfully
application/json
ResponseanyExample: {"message":"Invitation declined successfully","description":"You have declined the invitation successfully."}
400
Membership not found
application/json
500
Internal server error
application/json
put
PUT /teams/decline-invitation/{id} HTTP/1.1
Host: 
Accept: */*
{
  "message": "Invitation declined successfully",
  "description": "You have declined the invitation successfully."
}

Deletes a team by its ID.

delete
Path parameters
idstringRequired

The ID of the team to delete.

Example: team_id
Responses
200
Team deleted successfully
application/json
ResponseanyExample: {"message":"Team deleted successfully","description":"The team has been deleted successfully."}
400
Team not found
application/json
403
Access denied
application/json
500
Internal server error
application/json
delete
DELETE /teams/{id} HTTP/1.1
Host: 
Accept: */*
{
  "message": "Team deleted successfully",
  "description": "The team has been deleted successfully."
}
  • GET
  • GETRetrieves information about the authenticated user's team.
  • GETRetrieves members of the authenticated user's team.
  • GETRetrieves available team roles.
  • GETChecks the team limit for the authenticated user.
  • GETRetrieves all teams based on the provided parameters.
  • POST
  • POSTCreates a new team.
  • POSTCreates an invitation to join the team.
  • PUT
  • PUTLeaves a team by its ID. Sends an email to the new owner if provided. Also applies new owners subscription plan to this team.
  • PUTAccepts an invitation to join a team.
  • PUTDeclines an invitation to join a team.
  • DELETE
  • DELETECancels an invitation to join the team.
  • DELETEDeletes a team by its ID.

Creates a new team.

post
Body
teamNamestringOptionalExample: Team Name
Responses
201
Team created successfully
application/json
400
Team already exists
application/json
500
Internal server error
application/json
post
POST /teams HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 24

{
  "teamName": "Team Name"
}
{
  "id": "team_id",
  "name": "Team Name",
  "usersLimit": 5
}

Creates an invitation to join the team.

post
Body
emailstringRequiredExample: user@example.com
firstNamestring | nullableRequiredExample: John
lastNamestring | nullableRequiredExample: Doe
phonestring | nullableRequiredExample: 123-456-7890
rolestring ยท enumRequiredExample: ViewerPossible values:
teamIdstring | nullableRequiredExample: team_id
Responses
200
Invitation created successfully
application/json
ResponseanyExample: {"message":"Invitation email sent","description":"Wait for the invited person to finish their registration."}
400
Team is full
application/json
403
Access denied
application/json
500
Internal server error
application/json
post
POST /teams/invitation HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 122

{
  "email": "user@example.com",
  "firstName": "John",
  "lastName": "Doe",
  "phone": "123-456-7890",
  "role": "Viewer",
  "teamId": "team_id"
}
{
  "message": "Invitation email sent",
  "description": "Wait for the invited person to finish their registration."
}

Leaves a team by its ID. Sends an email to the new owner if provided. Also applies new owners subscription plan to this team.

put
Path parameters
idstringRequired

The ID of the team to leave.

Example: team_id
Body
newOwnerIdnumberOptionalExample: 1
Responses
200
Left the team successfully
application/json
ResponseanyExample: {"message":"Left the team successfully","description":"You have left the team successfully."}
400
Team not found
application/json
500
Internal server error
application/json
put
PUT /teams/leave-team/{id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "newOwnerId": 1
}
{
  "message": "Left the team successfully",
  "description": "You have left the team successfully."
}

Cancels an invitation to join the team.

delete
Path parameters
idnumberRequired

The ID of the user to cancel the invitation for.

Example: 1
Body
membershipIdnumberOptionalExample: 1
Responses
200
Invitation cancelled successfully
application/json
ResponseanyExample: {"message":"Invitation cancelled successfully","description":"The invitation has been cancelled successfully."}
400
User not found
application/json
500
Internal server error
application/json
delete
DELETE /teams/invitation/{id} HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 18

{
  "membershipId": 1
}
{
  "message": "Invitation cancelled successfully",
  "description": "The invitation has been cancelled successfully."
}