DocsTeamsMembers

Team Members

Manage team members.

List Members

Endpoint

GET ${baseUrl}/teams/members

Query Parameters

ParameterRequiredDescription
teamIdYesThe ID of the team to get members for.

Response

interface TeamMembersResponse {
  success: boolean
  data: {
    fullname: string | null
    email: string
    status: string
    userId: number
    teamId: number
    role: string
  }[]
}

Add Member

Endpoint

POST ${baseUrl}/teams/member/add

Request Body

interface AddTeamMemberRequest {
  memberEmail: string
  memberRole: 'MANAGER' | 'USER' | 'SUPERVISOR'
  teamId: number
}

Remove Member

Endpoint

DELETE ${baseUrl}/teams/member/delete

Request Body

interface DeleteTeamMemberRequest {
  memberId: number
  teamId: number
}

Example Requests

// List members
const members = await fetch('${baseUrl}/teams/members?teamId=123', {
  headers: {
    Authorization: 'Basic YOUR_API_KEY',
  },
})
 
// Add member
const addMember = await fetch('${baseUrl}/teams/member/add', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Basic YOUR_API_KEY',
  },
  body: JSON.stringify({
    memberEmail: 'newmember@example.com',
    memberRole: 'USER',
    teamId: 123,
  }),
})
 
// Remove member
const removeMember = await fetch('${baseUrl}/teams/member/delete', {
  method: 'DELETE',
  headers: {
    'Content-Type': 'application/json',
    Authorization: 'Basic YOUR_API_KEY',
  },
  body: JSON.stringify({
    memberId: 456,
    teamId: 123,
  }),
})

Error Codes

Status CodeDescription
200Success
201Member Added Successfully
204Member Removed Successfully
400Invalid Request
401Unauthorized
403Forbidden
404Team or Member Not Found
500Server Error