API reference / Obtain token
v1Get support

Obtain token

POST/api/v1/auth/obtain/token
Public · credentials in body

Exchange your client credentials for a short-lived access token. Send the token as a Bearer token on every subsequent request.

Body parameters
FieldTypeReqDescription
clientIdstringYour API key identifier.
clientSecretstringThe secret half of your credential pair.
Returns

A token envelope containing accessToken, tokenType, and expiresIn. See the example response in the panel.

Sandbox only

Try this endpoint

This endpoint does not require bearer-token authentication. If it returns an access token, the latest sandbox token is saved for this tab.
Requests are proxied through the docs app and never sent to live.
ResponseWaiting for request
Send a sandbox request to see the response here.
curl https://api.dev.mightypay.io/api/v1/auth/obtain/token \
-H "Content-Type: application/json" \
-d '{
"clientId": "test_mp_392839",
"clientSecret": "Wa3hohhsyf7jMcoyOGjnP83BfeT4sPl"
}'
{
"status": "SUCCESS",
"statusCode": "00",
"sessionId": "sess_9f2c1a",
"data": {
"accessToken": "eyJhbGciOiJIUzI1Ni...",
"tokenType": "Bearer",
"expiresIn": 3600
}
}