Skip to main content

Authentication

Most requests to the MagFi API require passing a JWT bearer token with your request. The steps are as follows:

  1. Obtain a token from POST /auth/login (see docs)
  2. Pass token in the Authorization header with subsequent requests:
    Authorization: Bearer <jwt-token>
  3. 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:

  1. Using your JWT-authenticated session, create a new key via POST /auth/api-key (see docs)
  2. Pass the returned apiKey in the Authorization header with subsequent requests:
    Authorization: Bearer magfi_TTHETW3bRCa5Erh04dfSa6ozQI9S6+om9qEEUqL6PZ8=