Sessions & credentials
Sign in, sign up, sessions, passwords, email verification.
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/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"}Change the password of the 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/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" }}Delete the 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/delete-user" \ -H "Content-Type: application/json" \ -d '{}'{ "success": true, "message": "User deleted"}Callback to complete user deletion with verification token
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Query Parameters
The token to verify the deletion request
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 the current session
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
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 }}Get the current 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/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 }}List all accounts linked to the user
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
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" ] }]List all active sessions for the user
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
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" }]Check if the API is working
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
application/json
curl -X GET "https://example.com/api/auth/ok"{ "ok": true}Send a password reset email to the 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/request-password-reset" \ -H "Content-Type: application/json" \ -d '{ "email": "string" }'{ "status": true, "message": "string"}Reset the password for 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/reset-password" \ -H "Content-Type: application/json" \ -d '{ "newPassword": "string" }'{ "status": true}Redirects the user to the callback URL with the token
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Path Parameters
The token to reset the password
Query Parameters
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"}Revoke all other sessions for the user except the current one
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/revoke-other-sessions" \ -H "Content-Type: application/json" \ -d '{}'{ "status": true}Revoke a single 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/revoke-session" \ -H "Content-Type: application/json" \ -d '{ "token": "string" }'{ "status": true}Revoke all sessions for the 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/revoke-sessions" \ -H "Content-Type: application/json" \ -d '{}'{ "status": true}Send a verification email to the 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/send-verification-email" \ -H "Content-Type: application/json" \ -d '{ "email": "string" }'{ "status": true}Sign in with email and 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/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 }}Sign out the current 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/sign-out" \ -H "Content-Type: application/json" \ -d '{}'{ "success": true, "url": "string", "redirect": true}Sign up a user using email and 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
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" }}Update the current 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/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" }}Update the current 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/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 }}Verify the email of the user
Authorization
bearerAuth Session token from the set-auth-token response header (bearer plugin)
In: header
Query Parameters
The token to verify the email
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}Verify the current 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/verify-password" \ -H "Content-Type: application/json" \ -d '{ "password": "string" }'{ "status": true}