DylogDocs

Sessions & credentials

Sign in, sign up, sessions, passwords, email verification.

POST
/api/auth/change-email

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/change-email" \  -H "Content-Type: application/json" \  -d '{    "newEmail": "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  },  "status": true,  "message": "Email updated"}
POST
/api/auth/change-password

Change the password of the 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/change-password" \  -H "Content-Type: application/json" \  -d '{    "newPassword": "string",    "currentPassword": "string"  }'
{  "token": "string",  "user": {    "id": "string",    "email": "user@example.com",    "name": "string",    "image": "http://example.com",    "emailVerified": true,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
POST
/api/auth/delete-user

Delete the 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/delete-user" \  -H "Content-Type: application/json" \  -d '{}'
{  "success": true,  "message": "User deleted"}
GET
/api/auth/delete-user/callback

Callback to complete user deletion with verification token

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Query Parameters

token?string

The token to verify the deletion request

callbackURL?string

The URL to redirect to after deletion

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/auth/delete-user/callback"
{  "success": true,  "message": "User deleted"}
GET
/api/auth/get-session

Get the current session

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

application/json

curl -X GET "https://example.com/api/auth/get-session"
{  "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/get-session

Get the current 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/get-session" \  -H "Content-Type: application/json" \  -d '{}'
{  "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  }}
GET
/api/auth/list-accounts

List all accounts linked to the user

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

application/json

curl -X GET "https://example.com/api/auth/list-accounts"
[  {    "id": "string",    "providerId": "string",    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "accountId": "string",    "userId": "string",    "scopes": [      "string"    ]  }]
GET
/api/auth/list-sessions

List all active sessions for the user

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

application/json

curl -X GET "https://example.com/api/auth/list-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/ok

Check if the API is working

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

application/json

curl -X GET "https://example.com/api/auth/ok"
{  "ok": true}
POST
/api/auth/request-password-reset

Send a password reset email to the 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/request-password-reset" \  -H "Content-Type: application/json" \  -d '{    "email": "string"  }'
{  "status": true,  "message": "string"}
POST
/api/auth/reset-password

Reset the password for 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/reset-password" \  -H "Content-Type: application/json" \  -d '{    "newPassword": "string"  }'
{  "status": true}
GET
/api/auth/reset-password/{token}

Redirects the user to the callback URL with the token

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Path Parameters

token*string

The token to reset the password

Query Parameters

callbackURL*string

The URL to redirect the user to reset their password

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/auth/reset-password/string?callbackURL=string"
{  "token": "string"}
POST
/api/auth/revoke-other-sessions

Revoke all other sessions for the user except the current one

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/revoke-other-sessions" \  -H "Content-Type: application/json" \  -d '{}'
{  "status": true}
POST
/api/auth/revoke-session

Revoke a single 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/revoke-session" \  -H "Content-Type: application/json" \  -d '{    "token": "string"  }'
{  "status": true}
POST
/api/auth/revoke-sessions

Revoke all sessions for the 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/revoke-sessions" \  -H "Content-Type: application/json" \  -d '{}'
{  "status": true}
POST
/api/auth/send-verification-email

Send a verification email to the 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/send-verification-email" \  -H "Content-Type: application/json" \  -d '{    "email": "string"  }'
{  "status": true}
POST
/api/auth/sign-in/email

Sign in with email and 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/sign-in/email" \  -H "Content-Type: application/json" \  -d '{    "email": "string",    "password": "string"  }'
{  "redirect": false,  "token": "string",  "url": "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/sign-out

Sign out the current 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/sign-out" \  -H "Content-Type: application/json" \  -d '{}'
{  "success": true,  "url": "string",  "redirect": true}
POST
/api/auth/sign-up/email

Sign up a user using email and 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

application/json

curl -X POST "https://example.com/api/auth/sign-up/email" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "email": "string",    "password": "string"  }'
{  "token": "string",  "user": {    "id": "string",    "email": "user@example.com",    "name": "string",    "image": "http://example.com",    "emailVerified": true,    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}
POST
/api/auth/update-session

Update the current 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/update-session" \  -H "Content-Type: application/json" \  -d '{    "property1": null,    "property2": null  }'
{  "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"  }}
POST
/api/auth/update-user

Update the current 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/update-user" \  -H "Content-Type: application/json" \  -d '{}'
{  "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/verify-email

Verify the email of the user

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Query Parameters

token*string

The token to verify the email

callbackURL?string

The URL to redirect to after email verification

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/api/auth/verify-email?token=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  },  "status": true}
POST
/api/auth/verify-password

Verify the current 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/verify-password" \  -H "Content-Type: application/json" \  -d '{    "password": "string"  }'
{  "status": true}