Help Doc Access Vani

TEAM MEMBERS API

Manage resources and operations related to team members.

GET Get Team Members

GET https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members

Retrieves the members present in a team.

Parameters

Name Type In Required Description
edition_id string path Required The unique ID of the edition.
team_id string path Required The unique ID of the team associated with the edition.

Responses

200 success
200 using filter fields
404 team not found
401 user not part of the team
success - Response
{ "data": { "team_members": [ { "role_name": "MEMBER", "added_time": "Tue, 21 Jan 2025, 13:29:58", "modified_time": "Tue, 21 Jan 2025, 13:29:58", "mail_id": "test@zohotest.com", "added_by": "85572741", "display_name": "naga", "zuid": "96384499" }, { "role_name": "TEAM_ADMIN", "added_time": "Sat, 30 Nov 2024, 22:32:11", "modified_time": "Sat, 30 Nov 2024, 22:32:11", "mail_id": "testadmin@zohotest.com", "added_by": "85572741", "display_name": "naga.vg+1dev", "zuid": "85572741" } ] }, "message": "Team members fetched successfully.", "request_uri": "/vani/api/v1/editions/75918186/teams/693000000450001/members", "status": "success" }

Code Examples

cURL Command line HTTP client
cURL
curl -X GET "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json"

GET Get Team Admins

GET https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members

Retrieves members with the Team Admin role from a team.

Parameters

Name Type In Required Description
member_type string query Required Role of the member to be fetched. The value TEAM_ADMIN retrieves only the team admins.
edition_id string path Required The unique ID of the edition.
team_id string path Required The unique ID of the team associated with the edition.

Responses

200 success
200 using filter fields
404 team not found
401 user not part of the team
success - Response
{ "data": { "team_admins": [ { "role_name": "TEAM_ADMIN", "added_time": "Tue, 21 Jan 2025, 17:05:47", "modified_time": "Tue, 21 Jan 2025, 17:05:47", "mail_id": "testadmin@zohotest.com", "added_by": "96384499", "display_name": "test_admin", "zuid": "96384499" } ] }, "message": "Team members fetched successfully.", "request_uri": "/vani/api/v1/editions/97375109/teams/1505000000002005/members", "status": "success" }

Code Examples

cURL Command line HTTP client
cURL
curl -X GET "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json"

POST Add Team Member(s)

POST https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members

Add member(s) to a specific team.

Parameters

Name Type In Required Description
edition_id string path Required The unique ID of the edition.
team_id string path Required The unique ID of the team associated with the edition.
members_info string body Based on Request An array of JSON objects containing the member’s email and role. Each object must include: mail_id, role. Note: Sending just one object will add a single member.
mail_id string body Based on Request Email of the member
role string body Based on Request Role to be assigned (MEMBER or TEAM_ADMIN).

Request Body

JSON
{ "members_info": [ { "mail_id": "test2@zohotest.com", "role": "MEMBER" } ] }

Responses

200 success
206 partial
400 already invited
400 license limit reached
401 unauthorized
success - Response
{ "data": { "added_members": [ { "role_name": "MEMBER", "invited_time": "Mon, 03 Feb 2025, 23:17:12", "edition_id": "97375109", "mail_id": "test2@zohotest.com", "added_by": "96384499", "team_id": "1505000000051031" } ] }, "message": "Team member added successfully.", "request_uri": "/vani/api/v1/editions/97375109/teams/1505000000051031/members", "status": "success" }

Code Examples

cURL Command line HTTP client
cURL
curl -X POST "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "members_info": [ { "mail_id": "test@gmail.com", "role": "MEMBER" } ] }'

PUT Update Team Member Role

PUT https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members/{member_id}

Updates the role of a specific team member in an edition.

Parameters

Name Type In Required Description
edition_id string path Required The unique ID of the edition.
team_id string path Required The unique ID of the team associated with the edition.
member_id string path Required The user ID (zuid) of the member to be updated.
role string body Based on Request New role to be assigned to the member (MEMBER or TEAM_ADMIN).

Request Body

JSON
{ "role": "TEAM_ADMIN" }

Responses

200 success - admin
200 success - member
409 has same role
403 cannot update own role
403 super admin can't update
404 member not part of the team
401 non team member try to update role
401 unauthorized
success - admin - Response
{ "data": { "current_user_id": "96384499", "new_role": "TEAM_ADMIN", "edition_id": "75918186", "team_id": "693000000436009", "zuid": "81479212" }, "message": "Team member updated successfully.", "request_uri": "/vani/api/v1/editions/75918186/teams/693000000436009/members", "status": "success" }

Code Examples

cURL Command line HTTP client
cURL
curl -X PUT "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members/{member_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "role": "TEAM_ADMIN" }'

DELETE Remove Team Member

DELETE https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members/{member_id}

Removes a specific member from a team in an edition.

Parameters

Name Type In Required Description
edition_id string path Required The unique ID of the edition.
team_id string path Required The unique ID of the team associated with the edition.
member_id string path Required The user ID (zuid) of the member to be deleted.
assign_to_zuid string body Based on Request The user ID (zuid) to whom the removed member’s records should be reassigned.

Request Body

JSON
{ "assign_to_zuid": "96384499" }

Responses

200 success
403 self remove
403 super admin can't remove
404 member not part of team
403 unauthorized
success - Response
{ "data": { "current_user_id": "96384499", "edition_id": "97375109", "team_id": "1505000000051031", "removed_zuid": "97377569" }, "message": "Team member deleted successfully.", "request_uri": "/vani/api/v1/editions/97375109/teams/1505000000051031/members", "status": "success" }

Code Examples

cURL Command line HTTP client
cURL
curl -X DELETE "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/teams/{team_id}/members/{member_id}" \ -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "assign_to_zuid": "85572741" }'