# User Management

## Overview

User management APIs in Akto allow you to manage access control and team membership within your organization. You can use these APIs to retrieve team details, invite new users, and remove existing users.

#### Available Endpoints

<table><thead><tr><th width="105.796875">Method</th><th width="223.45703125">Endpoint</th><th>Description</th></tr></thead><tbody><tr><td>POST</td><td><code>/api/getTeamData</code></td><td>Retrieves information about the current team, including user roles and details</td></tr><tr><td>POST</td><td><code>/api/inviteUsers</code></td><td>Sends invitations to new users to join your Akto workspace</td></tr><tr><td>POST</td><td><code>/api/removeUser</code></td><td>Removes an existing user from your Akto workspace</td></tr></tbody></table>

## POST /api/getTeamData

> POST request for endpoint /api/getTeamData

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/getTeamData":{"post":{"summary":"POST request for endpoint /api/getTeamData","operationId":"/api/getTeamData-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{},"description":"No request parameters required"}}}},"responses":{"200":{"description":"Successfully fetched team data","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","format":"int32"},"login":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","description":"User role in the account"}}},"description":"List of users and pending invitations"}}}}}}}}}
```

## POST /api/inviteUsers

> POST request for endpoint /api/inviteUsers

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/inviteUsers":{"post":{"summary":"POST request for endpoint /api/inviteUsers","operationId":"/api/inviteUsers-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"inviteeEmail":{"type":"string","description":"Email address of the user to invite. Must be valid email format and belong to same organization domain"},"inviteeName":{"type":"string","description":"Name of the user being invited"},"inviteeRole":{"type":"string","description":"Role to assign to invited user. Valid values: ADMIN, MEMBER, DEVELOPER, VIEWER, or custom role names. Must be within current user's role hierarchy"},"websiteHostName":{"type":"string","description":"Website host name for the invitation link"}},"required":["inviteeEmail","inviteeRole"],"description":"User invitation request with email and role"}}}},"responses":{"200":{"description":"Invitation sent successfully","content":{"application/json":{"schema":{"type":"object","properties":{"finalInviteCode":{"type":"string","description":"Complete invitation link to be sent to the invitee. Contains JWT code valid for 1 week"},"inviteeRole":{"type":"string","description":"Role assigned to the invited user"}},"description":"Successful invitation response containing the invite link and role"}}}},"400":{"description":"Invitation request validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message. Possible values: 'Invalid email', 'Email must belong to same organisation', 'User already exists', 'Invalid role', 'User not allowed to invite for this role', 'Inviting new users is not allowed for this account'"}}}}}}}}}}}
```

## POST /api/removeUser

> POST request for endpoint /api/removeUser

```json
{"openapi":"3.0.1","info":{"title":"AktoSwagger","version":"1.0.0"},"paths":{"/api/removeUser":{"post":{"summary":"POST request for endpoint /api/removeUser","operationId":"/api/removeUser-POST","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"Email address of the user to remove from the account"}},"required":["email"],"description":"User removal request with email"}}}},"responses":{"200":{"description":"User removed or invitation deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"id":{"type":"integer","format":"int32"},"passwordResetToken":{"type":"null"},"roleHierarchy":{"type":"string"},"userRoleHierarchy":{"type":"array","items":{"type":"string"}},"users":{"type":"null"}},"description":"Successful removal response"}}}},"400":{"description":"User removal failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","description":"Error message. Possible values: 'User not found' (if user doesn't exist in account and no pending invitation)"}}}}}}}}}}}
```
