Staff (admin)
User administration for Dylog staff.
Ban a user
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/ban-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{ "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false }}Create a new user
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/create-user" \ -H "Content-Type: application/json" \ -d '{ "email": "string", "name": "string" }'{ "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false }}Get an existing user
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Query Parameters
The id of the User
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/auth/admin/get-user"{ "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false }}Check if the user has permission
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/has-permission" \ -H "Content-Type: application/json" \ -d '{ "permissions": {} }'{ "error": "string", "success": true}Impersonate a user
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/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", "activeOrganizationId": "string", "impersonatedBy": "string" }, "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false }}List user sessions
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/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", "activeOrganizationId": "string", "impersonatedBy": "string" } ]}List users
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Query Parameters
The field to search in, defaults to email. Can be email or name. Eg: "name"
Value in
- "email"
- "name"
The operator to use for the search. Can be contains, starts_with or ends_with. Eg: "contains"
Value in
- "contains"
- "starts_with"
- "ends_with"
The field to sort by
The direction to sort by
Value in
- "asc"
- "desc"
The field to filter by
The operator to use for the filter
Value in
- "eq"
- "ne"
- "lt"
- "lte"
- "gt"
- "gte"
- "in"
- "not_in"
- "contains"
- "starts_with"
- "ends_with"
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/auth/admin/list-users"{ "users": [ { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false } ], "total": 0, "limit": 0, "offset": 0}Delete a user and all their sessions and accounts. Cannot be undone.
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/remove-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{ "success": true}Revoke a user session
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/revoke-user-session" \ -H "Content-Type: application/json" \ -d '{ "sessionToken": "string" }'{ "success": true}Revoke all user sessions
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/revoke-user-sessions" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{ "success": true}Set the role of a user
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/set-role" \ -H "Content-Type: application/json" \ -d '{ "userId": "string", "role": "string" }'{ "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false }}Set a user's password
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/set-user-password" \ -H "Content-Type: application/json" \ -d '{ "newPassword": "string", "userId": "string" }'{ "status": true}Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/stop-impersonating"{ "message": "string"}Unban a user
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/unban-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string" }'{ "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false }}Update a user's details
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/auth/admin/update-user" \ -H "Content-Type: application/json" \ -d '{ "userId": "string", "data": { "property1": null, "property2": null } }'{ "user": { "id": "string", "name": "string", "email": "string", "emailVerified": false, "image": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "role": "string", "banned": false, "banReason": "string", "banExpires": "2019-08-24T14:15:22Z", "twoFactorEnabled": false }}