Admin
Admin plugin endpoints for user management, banning, and impersonation.
Set Role
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The user id
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/set-role" \ -H "Content-Type: application/json" \ -d '{ "userId": "string", "role": "string" }'{
"user": {
"id": "string",
"name": "string",
"email": "string",
"emailVerified": true,
"image": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"username": "string",
"displayUsername": "string",
"twoFactorEnabled": true,
"role": "string",
"banned": true,
"banReason": "string",
"banExpires": "2019-08-24T14:15:22Z"
}
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Create User
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The email of the user
The password of the user
The name of the user
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/create-user" \ -H "Content-Type: application/json" \ -d '{ "email": "string", "password": "string", "name": "string" }'{
"user": {
"id": "string",
"name": "string",
"email": "string",
"emailVerified": true,
"image": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"username": "string",
"displayUsername": "string",
"twoFactorEnabled": true,
"role": "string",
"banned": true,
"banReason": "string",
"banExpires": "2019-08-24T14:15:22Z"
}
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}List Users
Authorization
bearerAuth Bearer token authentication
In: header
Query Parameters
The value to search for
The field to search in, defaults to email. Can be email or name
The operator to use for the search. Can be contains, starts_with or ends_with
The number of users to return
The offset to start from
The field to sort by
The direction to sort by
The field to filter by
The value to filter by
The operator to use for the filter
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "http://localhost:3001/api/auth/admin/list-users"{
"users": [
{
"id": "string",
"name": "string",
"email": "string",
"emailVerified": true,
"image": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"username": "string",
"displayUsername": "string",
"twoFactorEnabled": true,
"role": "string",
"banned": true,
"banReason": "string",
"banExpires": "2019-08-24T14:15:22Z"
}
],
"total": 0,
"limit": 0,
"offset": 0
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}List User Sessions
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The user id
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/list-user-sessions" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{
"sessions": [
{
"id": "string",
"expiresAt": "2019-08-24T14:15:22Z",
"token": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"ipAddress": "string",
"userAgent": "string",
"userId": "string",
"impersonatedBy": "string",
"activeOrganizationId": "string"
}
]
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Unban User
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The user id
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/unban-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{
"user": {
"id": "string",
"name": "string",
"email": "string",
"emailVerified": true,
"image": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"username": "string",
"displayUsername": "string",
"twoFactorEnabled": true,
"role": "string",
"banned": true,
"banReason": "string",
"banExpires": "2019-08-24T14:15:22Z"
}
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Ban User
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The user id
The reason for the ban
The number of seconds until the ban expires
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/ban-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{
"user": {
"id": "string",
"name": "string",
"email": "string",
"emailVerified": true,
"image": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"username": "string",
"displayUsername": "string",
"twoFactorEnabled": true,
"role": "string",
"banned": true,
"banReason": "string",
"banExpires": "2019-08-24T14:15:22Z"
}
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Impersonate User
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The user id
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/impersonate-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{
"session": {
"id": "string",
"expiresAt": "2019-08-24T14:15:22Z",
"token": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"ipAddress": "string",
"userAgent": "string",
"userId": "string",
"impersonatedBy": "string",
"activeOrganizationId": "string"
},
"user": {
"id": "string",
"name": "string",
"email": "string",
"emailVerified": true,
"image": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"username": "string",
"displayUsername": "string",
"twoFactorEnabled": true,
"role": "string",
"banned": true,
"banReason": "string",
"banExpires": "2019-08-24T14:15:22Z"
}
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}/admin/stop-impersonating
Authorization
bearerAuth Bearer token authentication
In: header
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/stop-impersonating"{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Revoke User Session
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The session token
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/revoke-user-session" \ -H "Content-Type: application/json" \ -d '{ "sessionToken": "string" }'{
"success": true
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Revoke User Sessions
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The user id
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/revoke-user-sessions" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{
"success": true
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Remove User
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The user id
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/remove-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{
"success": true
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}Set User Password
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The new password
The user id
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/set-user-password" \ -H "Content-Type: application/json" \ -d '{ "newPassword": "string", "userId": "string" }'{
"status": true
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}/admin/has-permission
Authorization
bearerAuth Bearer token authentication
In: header
Request Body
application/json
The permission to check
The permission to check
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "http://localhost:3001/api/auth/admin/has-permission" \ -H "Content-Type: application/json" \ -d '{ "permissions": {} }'{
"error": "string",
"success": true
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}{
"message": "string"
}