Api DocumentationLogin

Authentication API

This document explains how to complete the following tasks:

  • Authenticate a client to obtain access and refresh tokens.
  • Manage secure communication using JWT tokens.
  • Retrieve client-specific details and configuration status.

Required Roles

To get the permissions that you need to manage authentication and access the Swiftramp API, ensure your account is in an active state and you have the correct client_id and client_secret provided during registration.


User Authentication

This section provides details on how to authenticate your client and manage session tokens.

Client Login

Authenticates a user and provides access and refresh tokens for subsequent API requests.

Request Body Payload

Property NameTypeMandatoryLength/LimitDescription
emailstringYesMax 255The registered email address of the client.
client_secretstringYes-The secure secret key associated with the client account.

cURL Command

curl --request POST \
  --url https://api.swiftramp.in/v1/auth/login \
  --header 'Content-Type: application/json' \
  --data '{
  "email": "user@example.com",
  "client_secret": "test@12345"
}'

Response Payload

Property NameTypeDescription
statusbooleanIndicates if the request was successful.
codeintegerHTTP status code.
messagestringHuman-readable response message.
access_tokenstringJWT access token for authenticating API requests.
refresh_tokenstringJWT token used to obtain a new access token.
clientDetailsobjectDetailed information about the authenticated client.

Enums and Constants

Client Status

ValueDescription
activeAccount is fully functional.
inactiveAccount is created but not yet active.
suspendedAccount access has been temporarily revoked.
deletedAccount has been removed from the system.

KYB Status

ValueDescription
pendingBusiness verification is in progress.
successBusiness verification completed successfully.
failedBusiness verification failed.

Success Response (200 OK)

{
  "status": true,
  "code": 200,
  "message": "Login Successful",
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiN2Q4ZjNhMC01MGNiLTRhMjMtOWI4NS04NTk2MmQ1NmEzY2MiLCJjbGllbnRJZCI6ImI3ZDhmM2EwLTUwYmItNGFjMy05Yjg1LTg1OTYyZDU2YTNjYyIsImlhdCI6MTc1MjIxNTA5MSwiZXhwIjoxNzUyMjQ1MDkxLCJ0eXBlIjoiYWNjZXNzIiwicm9sZSI6ImNsaWVudCJ9.4Is99RKA01Aqy9DOrM5YiUiLqaBpKKWXT9GAIVzTL54",
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJiN2Q4ZjNhMC01MGNiLTRhMjMtOWI4NS04NTk2MmQ1NmEzY2MiLCJjbGllbnRJZCI6ImI3ZDhmM2EwLTUwY2ItNGFjMy05Yjg1LTg1OTYyZDU2YTNjYyIsImlhdCI6MTc1MjIxNTA5MSwiZXhwIjoyMDExNDE1MDkxLCJ0eXBlIjoicmVmcmVzaCIsInJvbGUiOiJjbGllbnQifQ.W8gxEct2uiTRjQ-BFHzkGHHw8NPJjWTFvA0Ld8Fuqu0",
  "clientDetails": {
      "client_id": "7b3f5c6e-558b-43cb-800d-7245a73b2d2b",
      "email": "test@swiftramp.in",
      "client_secret": "$2b$08$uvLCoiyPLO2DRKnM.ypLteblT2QnaoSddKToo70yo8CbRFjluYa7y",
      "email_verified": true,
      "name": "test",
      "status": "active",
      "check_kyc": true,
      "kyb_status": null,
      "created_at": "2026-03-02T06:15:56.438Z",
      "updated_at": "2026-03-02T06:16:40.161Z"
  }
}

Error Responses (400 Bad Request)

Invalid Email Address

{
  "status": false,
  "code": 400,
  "message": "Invalid Email Address!",
  "data": {}
}

Wrong Password

{
  "status": false,
  "code": 400,
  "message": "Wrong Password",
  "data": {}
}

  • 💡 In the cURL example above, ensure you replace the placeholder email and secret with your actual credentials.
  • 💡 Access tokens are typically short-lived; use the refresh_token to maintain session continuity.