Skip to main content

User Login

POST 

/v1/users/login

Using email let us create access token which can be utilised for subsequent api request, without this, request will be denied with reason as unauthorised.

Signed Requests (Trusted Issuance)

This endpoint requires your account's calling IP to be whitelisted, and a signed x-timestamp / x-signature header pair proving the request genuinely originates from your backend (not just anyone holding a leaked x-api-key). Both are mandatory on every request.

HeaderDescription
x-timestampCurrent Unix timestamp (seconds). Must be within 5 minutes of server time.
x-signaturehex(HMAC-SHA256(apiSecret, apiKey + ":" + timestamp)), computed with your Client Secret.
IP whitelisting is mandatory

Your calling IP must be whitelisted on your merchant account, or every request to this endpoint is rejected with 403 Forbidden. Contact tech team or support@onmeta.in to whitelist the IP's.

Signature is mandatory

x-timestamp and x-signature are required on every request. If either header is missing, incomplete, stale, or doesn't match, the request is rejected with 401 Unauthorized.

Code for generating x-timestamp / x-signature

const crypto = require("crypto");

function signTrustedIssuance(apiKey, apiSecret, timestamp) {
const payload = `${apiKey}:${timestamp}`;
return crypto.createHmac("sha256", apiSecret).update(payload).digest("hex");
}

const apiKey = "<CLIENT_ID>";
const apiSecret = "<CLIENT_SECRET>";
const timestamp = Math.floor(Date.now() / 1000).toString();
const signature = signTrustedIssuance(apiKey, apiSecret, timestamp);

console.log({ timestamp, signature });

Where to find your Client Secret

Log in to your Merchant DashboardSetupAPI's Setup. Use the Client Secret (not the Client ID) as apiSecret. Keep this value private and never expose it in client-side code or public repositories.


Access token expiry

Access tokens expire after 15 minutes.

JWT Claims

The accessToken returned is a signed JWT. Its payload contains the following claims:

ClaimTypeDescription
subStringUnique user identifier (ULID)
audStringYour application's Client ID — unique per API key
issStringToken issuer (https://iam.onmeta.io/onmeta)
iatIntegerIssued-at time (Unix timestamp)
expIntegerExpiration time (Unix timestamp) — 15 minutes after iat
jtiStringUnique JWT identifier (UUID/ULID) — used for request tracing and replay prevention
tenant_idStringInternal Onmeta tenant identifier

Request

Responses

Returns access and refresh tokens for the authenticated user.