Team API Endpoints
Manage teams and team members via the API.
Base URL
https://api.wizchat.com/v1
List Teams
Get all teams you're a member of.
Endpoint
GET /teams
Request
curl https://api.wizchat.com/v1/teams \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"teams": [
{
"id": "team_abc",
"name": "Engineering",
"role": "admin",
"memberCount": 5,
"createdAt": "2024-01-01T00:00:00Z"
}
]
}
Get Team Details
Get details about a specific team.
Endpoint
GET /teams/{teamId}
Request
curl https://api.wizchat.com/v1/teams/team_abc \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"id": "team_abc",
"name": "Engineering",
"description": "Engineering team chatbots",
"memberCount": 5,
"chatbotCount": 3,
"owner": {
"id": "user_123",
"email": "owner@example.com"
},
"createdAt": "2024-01-01T00:00:00Z"
}
List Team Members
Get all members of a team.
Endpoint
GET /teams/{teamId}/members
Request
curl https://api.wizchat.com/v1/teams/team_abc/members \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"members": [
{
"id": "user_123",
"email": "user@example.com",
"name": "John Doe",
"role": "admin",
"status": "active",
"joinedAt": "2024-01-01T00:00:00Z"
}
],
"pagination": {
"page": 1,
"perPage": 20,
"total": 5
}
}
Invite Team Member
Send an invitation to join the team.
Endpoint
POST /teams/{teamId}/invitations
Request
curl -X POST https://api.wizchat.com/v1/teams/team_abc/invitations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email": "newuser@example.com",
"role": "member"
}'
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email to invite |
role | string | Yes | admin or member |
Response
{
"id": "inv_xyz",
"email": "newuser@example.com",
"role": "member",
"status": "pending",
"expiresAt": "2024-02-08T00:00:00Z",
"createdAt": "2024-02-01T00:00:00Z"
}
Remove Team Member
Remove a member from the team.
Endpoint
DELETE /teams/{teamId}/members/{userId}
Request
curl -X DELETE https://api.wizchat.com/v1/teams/team_abc/members/user_456 \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"success": true,
"message": "Member removed"
}
Update Member Role
Change a team member's role.
Endpoint
PATCH /teams/{teamId}/members/{userId}
Request
curl -X PATCH https://api.wizchat.com/v1/teams/team_abc/members/user_456 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"role": "admin"
}'
Response
{
"id": "user_456",
"role": "admin",
"updatedAt": "2024-02-01T10:00:00Z"
}
List Team Chatbots
Get chatbots shared with the team.
Endpoint
GET /teams/{teamId}/chatbots
Request
curl https://api.wizchat.com/v1/teams/team_abc/chatbots \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"chatbots": [
{
"id": "cb_123",
"name": "Support Bot",
"owner": {
"id": "user_123",
"email": "owner@example.com"
},
"accessLevel": "edit",
"sharedAt": "2024-01-15T00:00:00Z"
}
]
}