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 Name | Type | Mandatory | Length/Limit | Description |
|---|---|---|---|---|
email | string | Yes | Max 255 | The registered email address of the client. |
client_secret | string | Yes | - | 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 Name | Type | Description |
|---|---|---|
status | boolean | Indicates if the request was successful. |
code | integer | HTTP status code. |
message | string | Human-readable response message. |
access_token | string | JWT access token for authenticating API requests. |
refresh_token | string | JWT token used to obtain a new access token. |
clientDetails | object | Detailed information about the authenticated client. |
Enums and Constants
Client Status
| Value | Description |
|---|---|
active | Account is fully functional. |
inactive | Account is created but not yet active. |
suspended | Account access has been temporarily revoked. |
deleted | Account has been removed from the system. |
KYB Status
| Value | Description |
|---|---|
pending | Business verification is in progress. |
success | Business verification completed successfully. |
failed | Business 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_tokento maintain session continuity.