Team Members
Manage team members.
List Members
Endpoint
GET ${baseUrl}/teams/members
Query Parameters
Parameter | Required | Description |
---|---|---|
teamId | Yes | The 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 Code | Description |
---|---|
200 | Success |
201 | Member Added Successfully |
204 | Member Removed Successfully |
400 | Invalid Request |
401 | Unauthorized |
403 | Forbidden |
404 | Team or Member Not Found |
500 | Server Error |