Authentication
Most requests to the MagFi API require passing a JWT bearer token with your request. The steps are as follows:
- Obtain a token from
POST /auth/login
(see docs) - Pass
token
in theAuthorization
header with subsequent requests:
Authorization: Bearer <jwt-token>
- Check the JWT expiry time to know when to request a new token. By default, tokens expire in 1 hour.
API Key Generation
For a persistent, revokable API key, you can generate one:
- Using your JWT-authenticated session, create a new key via
POST /auth/api-key
(see docs) - Pass the returned
apiKey
in theAuthorization
header with subsequent requests:
Authorization: Bearer magfi_TTHETW3bRCa5Erh04dfSa6ozQI9S6+om9qEEUqL6PZ8=