Teams & Users
Manage teams (operator grouping + channel access), company members, and email invitations for new users. Roles are assigned at the company level (admin/manager/agent) via Spatie permissions in teams mode — one user can belong to multiple companies with different roles in each. The public, unauthenticated invitation-resolution steps (resolve/context/intent) are out of scope for this reference — see the invitations guide.
Endpoints
| Method | Path | Summary |
|---|---|---|
| GET | /v1/teamsList teams | List teams |
| POST | /v1/teamsCreate a team | Create a team |
| GET | /v1/teams/{team}Get a team | Get a team |
| PATCH | /v1/teams/{team}Update a team | Update a team |
| DELETE | /v1/teams/{team}Delete a team | Delete a team |
| GET | /v1/companies/current/membersList current company members | List current company members |
| POST | /v1/companies/current/members/{memberId}/roleChange a member's role | Change a member's role |
| POST | /v1/companies/current/members/{memberId}/revokeRevoke a member's access | Revoke a member's access |
| GET | /v1/usersList current company users (excluding service accounts) | List current company users (excluding service accounts) |
| POST | /v1/invitationsSend an invitation (email + role) | Send an invitation (email + role) |
| POST | /v1/invitations/{guid}/acceptAccept an invitation | Accept an invitation |
| POST | /v1/invitations/{guid}/declineDecline an invitation | Decline an invitation |
| POST | /v1/invitations/{invitationId}/roleChange the role on a pending invitation | Change the role on a pending invitation |
| POST | /v1/invitations/{invitationId}/revokeRevoke an invitation | Revoke an invitation |
| DELETE | /v1/invitations/{invitationId}Delete an invitation | Delete an invitation |
Examples
Invite a new user
Request
curl -X POST https://api.aisar.app/v1/invitations \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "new.agent@example.com",
"role": "agent"
}'Response
{
"data": {
"message": "Invitation sent.",
"invitation": {
"id": 77,
"guid": "b6e2a4d0-1234-4a90-9e21-5d3f0c8a9b11",
"invite_url": "https://my.aisar.app/invitation/b6e2a4d0-1234-4a90-9e21-5d3f0c8a9b11",
"email": "new.agent@example.com",
"role": "agent",
"expires_at": "2026-03-22T10:00:00.000000Z"
}
}
}Create a team
Request
curl -X POST https://api.aisar.app/v1/teams \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Support",
"description": "Customer success team",
"channel_access_mode": "custom",
"channel_ids": [7, 9],
"member_ids": [5, 6]
}'Response
{
"data": {
"message": "Team created.",
"team": {
"id": 3,
"company_id": 1,
"name": "Support",
"description": "Customer success team",
"channel_access": { "mode": "custom", "channel_ids": [7, 9] },
"member_ids": [5, 6],
"created_at": "2026-03-15T10:00:00.000000Z",
"updated_at": "2026-03-15T10:00:00.000000Z"
}
}
}