Skip to Content

AuthApi

All URIs are relative to https://business.apis.kesk.app/v1 

MethodHTTP requestDescription
changePasswordPOST /auth/change-passwordUpdate account password
forgotPasswordPOST /auth/forgot-passwordInitiate password reset process
loginPOST /auth/loginAuthenticate user and generate access token
logoutPOST /auth/logoutEnd user session and invalidate token
profileUpdatePUT /profile/updateUpdate user profile information
refreshTokenPOST /auth/refresh-tokenRefresh access token
resendEmailOtpPOST /otp/resend/emailResend email verification OTP
resendMobileOtpPOST /otp/resend/mobileResend mobile phone verification OTP
resetPasswordWithOtpPOST /auth/reset-password-otpReset password using OTP
sendOtpPOST /otp/sendSend OTP code to phone number
signupPOST /auth/signupCreate a new user account
verifyEmailOtpPOST /otp/verify/emailVerify email address with OTP code
verifyMobileOtpPOST /otp/verify/mobileVerify mobile phone number with OTP code
verifyOtpPOST /otp/verifyVerify OTP code
verifyPhoneAccountGET /verify/phoneCheck if phone number is registered
verifySignupOtpPOST /auth/verify-signup-otpVerify email address after signup

changePassword

MessageResponse changePassword(ChangePasswordRequest)

Update account password

Changes the authenticated user’s password by validating their current password and updating it to the new value. Requires the user to provide both current and new passwords.

Parameters

NameTypeDescriptionNotes
ChangePasswordRequestChangePasswordRequestCurrent password and new password

Return type

MessageResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

forgotPassword

ForgotPasswordSuccessResponse forgotPassword(ForgotPasswordRequest)

Initiate password reset process

Sends a password reset OTP to the user’s registered email address. If the user’s email is not verified, sends a verification OTP instead and indicates that email verification is required before password reset. For security purposes, the response does not indicate whether an account with the provided email exists when the account is not found.

Parameters

NameTypeDescriptionNotes
ForgotPasswordRequestForgotPasswordRequestEmail address to send password reset OTP

Return type

ForgotPasswordSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

login

LoginSuccessResponse login(LoginRequest)

Authenticate user and generate access token

Validates user credentials (email and password) and returns a JWT authentication token upon successful login. The token should be included in subsequent API requests for authorization.

Parameters

NameTypeDescriptionNotes
LoginRequestLoginRequestUser credentials containing email and password

Return type

LoginSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

logout

MessageResponse logout(authorization)

End user session and invalidate token

Logs out the authenticated user by invalidating their current session token and updating their online status. The token can no longer be used for subsequent requests. Returns success even if the token is expired or invalid (graceful logout).

Parameters

NameTypeDescriptionNotes
authorizationStringOptional JWT bearer token for logout[optional] [default to null]

Return type

MessageResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

profileUpdate

ProfileUpdateResponse profileUpdate(ProfileUpdateRequest)

Update user profile information

Modifies the authenticated user’s profile details including name, email, phone number, gender, and online status. Changes are validated before being applied to the account.

Parameters

NameTypeDescriptionNotes
ProfileUpdateRequestProfileUpdateRequestUpdated profile information fields

Return type

ProfileUpdateResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

refreshToken

RefreshTokenResponse refreshToken(RefreshTokenRequest)

Refresh access token

Exchanges a valid refresh token for a new access token and refresh token pair. The old refresh token is invalidated (rotated) for security. Use this endpoint when the access token expires to obtain a new one without requiring re-authentication.

Parameters

NameTypeDescriptionNotes
RefreshTokenRequestRefreshTokenRequestRefresh token request containing the refresh token

Return type

RefreshTokenResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

resendEmailOtp

OtpSuccessResponse resendEmailOtp(ResendEmailOtpRequest)

Resend email verification OTP

Generates and sends a new one-time password to the user’s email address. Use this when the previous OTP has expired or was not received by the user.

Parameters

NameTypeDescriptionNotes
ResendEmailOtpRequestResendEmailOtpRequestEmail address to send new OTP

Return type

OtpSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

resendMobileOtp

OtpSuccessResponse resendMobileOtp(ResendMobileOtpRequest)

Resend mobile phone verification OTP

Generates and sends a new one-time password to the user’s mobile phone via SMS. Use this when the previous OTP has expired or was not received by the user.

Parameters

NameTypeDescriptionNotes
ResendMobileOtpRequestResendMobileOtpRequestMobile number to send new OTP

Return type

OtpSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

resetPasswordWithOtp

ResetPasswordSuccessResponse resetPasswordWithOtp(ResetPasswordWithOtpRequest)

Reset password using OTP

Validates the OTP sent via forgot-password and updates the user’s password to the new value. The OTP is single-use and expires after 10 minutes.

Parameters

NameTypeDescriptionNotes
ResetPasswordWithOtpRequestResetPasswordWithOtpRequestEmail, OTP, and new password

Return type

ResetPasswordSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

sendOtp

OtpResponse sendOtp(SendOtpInput)

Send OTP code to phone number

Generates and sends a one-time password via SMS to the specified phone number. For login purposes, validates that the phone number is associated with an active account. OTP codes expire after a configured time period and can only be used once.

Parameters

NameTypeDescriptionNotes
SendOtpInputSendOtpInputOTP request containing phone number and purpose

Return type

OtpResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

signup

SignupSuccessResponse signup(SignupRequest)

Create a new user account

Registers a new user with email and optional phone number. Sends a verification OTP to the provided email address that must be verified before the account can be activated and used for login.

Parameters

NameTypeDescriptionNotes
SignupRequestSignupRequestUser registration details including name, email, phone, and password

Return type

SignupSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

verifyEmailOtp

OtpSuccessResponse verifyEmailOtp(VerifyEmailOtpRequest)

Verify email address with OTP code

Validates a one-time password sent to the user’s email address for email verification purposes. Used for confirming email ownership during profile updates or security verification.

Parameters

NameTypeDescriptionNotes
VerifyEmailOtpRequestVerifyEmailOtpRequestEmail address and OTP code to verify

Return type

OtpSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

verifyMobileOtp

OtpSuccessResponse verifyMobileOtp(VerifyMobileOtpRequest)

Verify mobile phone number with OTP code

Validates a one-time password sent to the user’s mobile phone via SMS for phone verification. Used for confirming phone number ownership during registration or profile updates.

Parameters

NameTypeDescriptionNotes
VerifyMobileOtpRequestVerifyMobileOtpRequestMobile number and OTP code to verify

Return type

OtpSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

verifyOtp

OtpResponse verifyOtp(VerifyOtpInput)

Verify OTP code

Validates the provided OTP code against the phone number and marks it as consumed. For login flows, returns a JWT token upon successful verification and marks the phone number as verified. For generic verification, confirms the OTP without issuing a token.

Parameters

NameTypeDescriptionNotes
VerifyOtpInputVerifyOtpInputVerification request containing phone number, code, and purpose

Return type

OtpResponse

Authorization

JwtAuthScheme

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8

verifyPhoneAccount

PhoneVerificationResponse verifyPhoneAccount(phone)

Check if phone number is registered

Verifies whether a phone number is already registered in the system. Used during signup or profile updates to check phone number availability and prevent duplicates.

Parameters

NameTypeDescriptionNotes
phoneStringPhone number to verify[default to null]

Return type

PhoneVerificationResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

verifySignupOtp

VerifySignupOtpSuccessResponse verifySignupOtp(VerifySignupOtpRequest)

Verify email address after signup

Validates the OTP sent to the user’s email during registration. Upon successful verification, the account is activated and a JWT authentication token is returned for immediate login.

Parameters

NameTypeDescriptionNotes
VerifySignupOtpRequestVerifySignupOtpRequestEmail address and OTP code to verify

Return type

VerifySignupOtpSuccessResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: application/json; charset=utf-8