DylogDocs

Staff (admin)

User administration for Dylog staff.

POST
/api/auth/admin/ban-user

Ban a user

Authorization

bearerAuth
AuthorizationBearer <token>

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  }}
POST
/api/auth/admin/create-user

Create a new user

Authorization

bearerAuth
AuthorizationBearer <token>

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
/api/auth/admin/get-user

Get an existing user

Authorization

bearerAuth
AuthorizationBearer <token>

Session token from the set-auth-token response header (bearer plugin)

In: header

Query Parameters

id?string

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  }}
POST
/api/auth/admin/has-permission

Check if the user has permission

Authorization

bearerAuth
AuthorizationBearer <token>

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}
POST
/api/auth/admin/impersonate-user

Impersonate a user

Authorization

bearerAuth
AuthorizationBearer <token>

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  }}
POST
/api/auth/admin/list-user-sessions

List user sessions

Authorization

bearerAuth
AuthorizationBearer <token>

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"    }  ]}
GET
/api/auth/admin/list-users

List users

Authorization

bearerAuth
AuthorizationBearer <token>

Session token from the set-auth-token response header (bearer plugin)

In: header

Query Parameters

searchValue?string
searchField?string

The field to search in, defaults to email. Can be email or name. Eg: "name"

Value in

  • "email"
  • "name"
searchOperator?string

The operator to use for the search. Can be contains, starts_with or ends_with. Eg: "contains"

Value in

  • "contains"
  • "starts_with"
  • "ends_with"
limit?|number
offset?|number
sortBy?string

The field to sort by

sortDirection?string

The direction to sort by

Value in

  • "asc"
  • "desc"
filterField?string

The field to filter by

filterValue?|number|boolean|array<string>|array<number>
filterOperator?string

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}
POST
/api/auth/admin/remove-user

Delete a user and all their sessions and accounts. Cannot be undone.

Authorization

bearerAuth
AuthorizationBearer <token>

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}
POST
/api/auth/admin/revoke-user-session

Revoke a user session

Authorization

bearerAuth
AuthorizationBearer <token>

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}
POST
/api/auth/admin/revoke-user-sessions

Revoke all user sessions

Authorization

bearerAuth
AuthorizationBearer <token>

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}
POST
/api/auth/admin/set-role

Set the role of a user

Authorization

bearerAuth
AuthorizationBearer <token>

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  }}
POST
/api/auth/admin/set-user-password

Set a user's password

Authorization

bearerAuth
AuthorizationBearer <token>

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}
POST
/api/auth/admin/stop-impersonating

Authorization

bearerAuth
AuthorizationBearer <token>

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"}
POST
/api/auth/admin/unban-user

Unban a user

Authorization

bearerAuth
AuthorizationBearer <token>

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  }}
POST
/api/auth/admin/update-user

Update a user's details

Authorization

bearerAuth
AuthorizationBearer <token>

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  }}