SpareSpare Docs
GuidesAPI Reference

Authentication

Obtain and refresh API access tokens using client credentials.

GET
/auth/.well-known/jwks.json

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/auth/.well-known/jwks.json"
{  "keys": [    {      "alg": "string",      "crv": "string",      "e": "string",      "kid": "string",      "kty": "string",      "n": "string",      "use": "sig",      "x": "string",      "y": "string"    }  ]}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "not_found",  "details": {},  "message": "string"}
GET
/auth/.well-known/jwks/{provider}
Path

Bank provider code or ID, from the providers list.

Header

Regulatory jurisdiction the request routes to (e.g. `UAE`, `KSA`, `MAIN`). Match it to the market you're integrating.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/auth/.well-known/jwks/string" \  -H "x-tenant: KSA"
{  "keys": [    {      "alg": "string",      "crv": "string",      "e": "string",      "kid": "string",      "kty": "string",      "n": "string",      "use": "sig",      "x": "string",      "y": "string"    }  ]}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "not_found",  "details": {},  "message": "string"}
POST
/auth/api-keys/sessions
Header

Regulatory jurisdiction the request routes to (e.g. `UAE`, `KSA`, `MAIN`). Match it to the market you're integrating.

Your application's App ID, from the developer dashboard.

Your application's API key, from the developer dashboard.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/auth/api-keys/sessions" \  -H "x-tenant: KSA" \  -H "app-id: string" \  -H "x-api-key: string"
{  "data": {    "accessToken": "<jwt>",    "expiresIn": 3600,    "tokenType": "Bearer"  }}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "not_found",  "details": {},  "message": "string"}
POST
/auth/api-keys/sessions/refresh
Header

Regulatory jurisdiction the request routes to (e.g. `UAE`, `KSA`, `MAIN`). Match it to the market you're integrating.

The refresh token issued with your access token, used to renew the session.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/auth/api-keys/sessions/refresh" \  -H "x-tenant: KSA"
{  "access_token": "string",  "expires_in": 0,  "refresh_expires_in": 0,  "refresh_token": "string",  "type": "Bearer"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "string",  "details": {},  "message": "string"}
{  "code": "not_found",  "details": {},  "message": "string"}