User

APIs for User Management

User information

User information

SecurityapiKey
Request
header Parameters
X-Client-Id
string

client id registered with AuthN

X-Tenant
string

Tenant name

Responses
200

User Info

401

Authorization information is missing or invalid

500

Internal server error

get/user_info/
Request samples
Response samples
application/json
{
  • "id": 0,
  • "username": "string",
  • "email": "user@example.com",
  • "first_name": "string",
  • "last_name": "string",
  • "full_name": "string",
  • "is_staff": true,
  • "is_superuser": true,
  • "is_active": true,
  • "profile": {
    },
  • "emm": {
    },
  • "last_login": "string",
  • "token": "string",
  • "has_emm": true,
  • "is_email_verified": true
}

Invite a user

Invite a user to a tenant

SecurityapiKey
Request
path Parameters
enterprise_id
required
string <uuid>

Enterprise ID

Request Body schema: application/json
required
email
required
string <email> (email)
required
object (TenantUserInviteMeta)
connection_id
string (connection id)
Responses
201

Invite sent to user

400

tenant user invite create error

401

Unauthorized

post/authn2/v0/tenant/{enterprise_id}/invite
Request samples
application/json
{
  • "email": "user@example.com",
  • "meta": {
    },
  • "connection_id": "string"
}
Response samples
application/json
{
  • "id": "string",
  • "email": "user@example.com",
  • "tenant_id": "string",
  • "idp_invite_id": "string",
  • "meta": { },
  • "connection_id": "string",
  • "send_invitation_email": true,
  • "invitation_url": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

List user invites

List user invites in a tenant

SecurityapiKey
Request
path Parameters
enterprise_id
required
string <uuid>

Enterprise ID

Responses
201

Tenant user invites

400

List tenant user invites error

401

Unauthorized

get/authn2/v0/tenant/{enterprise_id}/invite
Request samples
Response samples
application/json
{
  • "count": 0,
  • "userinvites": [
    ]
}

Delete a invite

Delete a invite

SecurityapiKey
Request
path Parameters
enterprise_id
required
string <uuid>

Enterprise ID

invite_id
required
string <uuid>

Invite ID

Responses
204

Deleted tenant user invite

400

Tenant user invite delete error

401

Unauthorized

delete/authn2/v0/tenant/{enterprise_id}/invite/{invite_id}
Request samples
Response samples
application/json
{
  • "status": 0,
  • "code": 0,
  • "error": "string",
  • "errors": [
    ],
  • "message": "string"
}

Get Users

Get a list of users in the tenant

SecurityapiKey
Responses
200

Users List

401

Authorization information is missing or invalid

500

Internal server error

get/user/
Request samples
Response samples
application/json
{
  • "count": 0,
  • "previous": "string",
  • "next": "string",
  • "results": [
    ]
}

Get User Information

Get User Information

SecurityapiKey
Request
path Parameters
user_id
required
integer

User ID

Responses
200

User Details

401

Authorization information is missing or invalid

404

Not Found

500

Internal server error

get/user/{user_id}/
Request samples
Response samples
application/json
{
  • "id": 0,
  • "username": "string",
  • "email": "user@example.com",
  • "first_name": "string",
  • "last_name": "string",
  • "full_name": "string",
  • "is_staff": true,
  • "is_superuser": true,
  • "is_active": true,
  • "profile": {
    },
  • "emm": {
    },
  • "last_login": "string",
  • "token": "string",
  • "has_emm": true,
  • "is_email_verified": true
}

Update user role

Update user's role

SecurityapiKey
Request
path Parameters
user_id
required
string <uuid>

AuthN User Id. The authn_user_id from the Get Users response.

Request Body schema: application/json
required
authz_role_id
string <uuid> (Custom role id. Required only if role is AuthZ Role User)
can_factory_reset
boolean (If user should be able to factory reset or not)
has_all_group_access
boolean (If user has access to all groups or not. Required only if role is AuthZ Role User)
groups
required
Array of strings (List of group IDs. Can be empty if has_all_group_access is True or if the user role is not Group Admin/Group Viewer)
role
required
string (Role. Role should be AuthZ Role User for custom role)
Enum: "Shoonya Admin" "Enterprise Admin" "Enterprise User" "Viewer" "Group Admin" "Group Viewer" "AuthZ Role User"
Responses
200

User Updated Successfully

400

Bad Request

401

Unauthorized

403

Forbidden, no permission to perform this action.

put/authz2/v1/users/{user_id}
Request samples
application/json
{
  • "authz_role_id": "c85d5e04-56ba-49f9-8ef1-94165471fa4c",
  • "can_factory_reset": true,
  • "has_all_group_access": true,
  • "groups": [
    ],
  • "role": "Shoonya Admin"
}
Response samples
application/json
{
  • "id": 0,
  • "username": "string",
  • "email": "user@example.com",
  • "first_name": "string",
  • "last_name": "string",
  • "full_name": "string",
  • "is_staff": true,
  • "is_superuser": true,
  • "is_active": true,
  • "profile": {
    },
  • "emm": {
    },
  • "last_login": "string",
  • "token": "string",
  • "has_emm": true,
  • "is_email_verified": true
}

Update user profile

Update user's profile

SecurityapiKey
Request
path Parameters
enterprise_id
required
string <uuid>

Enterprise ID

user_id
required
string <uuid>

AuthN User Id. The authn_user_id from the Get Users response.

Request Body schema: application/json
required
first_name
required
string (first name)
Responses
200

User Updated Successfully

400

Bad Request

401

Unauthorized

403

Forbidden, no permission to perform this action.

put/authn2/v0/user/{user_id}
Request samples
application/json
{
  • "first_name": "string"
}
Response samples
application/json
{
  • "id": 0,
  • "username": "string",
  • "email": "user@example.com",
  • "first_name": "string",
  • "last_name": "string",
  • "full_name": "string",
  • "is_staff": true,
  • "is_superuser": true,
  • "is_active": true,
  • "profile": {
    },
  • "emm": {
    },
  • "last_login": "string",
  • "token": "string",
  • "has_emm": true,
  • "is_email_verified": true
}

Get user groups

Get user's groups

SecurityapiKey
Request
path Parameters
user_id
required
string <uuid>

AuthN User Id. The authn_user_id from the Get Users response.

query Parameters
sub_groups
boolean

Set to true to get a list of the user’s subgroup access. Users have access to their group’s subgroups.

Responses
200

User Groups

400

Bad Request

401

Unauthorized

403

Forbidden, no permission to perform this action.

get/authz2/v1/users/{user_id}/groups
Request samples
Response samples
application/json
{
  • "group_ids": [
    ],
  • "has_all_group_access": true
}

Delete a user from Enterprise

Delete a user from Enterprise

SecurityapiKey
Request
path Parameters
enterprise_id
required
string <uuid>

Enterprise ID

user_id
required
string <uuid>

AuthN User Id. The authn_user_id from the Get Users response.

Responses
204

Deleted enterprise user

400

Enterprise user delete error

401

Unauthorized

delete/authn2/v0/tenant/{enterprise_id}/user/{user_id}/
Request samples
Response samples
application/json
{
  • "status": 0,
  • "code": 0,
  • "error": "string",
  • "errors": [
    ],
  • "message": "string"
}