InstafuelInstafuel
FREN
  • Guides
  • Référence
  • Référence API
Guides
  • Démarrage rapide
  • Clés d'API
  • Référence API
Référence
  • Codes d'erreur
  • Glossaire
  • English
Environnement
  • Staging — instafuel-backend-staging.up.railway.app

© Instafuel — Abidjan, Côte d'Ivoire

HomeQuickstartAuthenticationAPI keysBusiness introducerWallet creditErrors and idempotencyLimits and quotasScopeWebhooks
powered by Zudoku
Guides

API keys

A partner API key identifies your introducer account, carries its scopes and determines its data perimeter. This page covers its whole lifecycle.

Anatomy of a key

Code
ifp_live_9f2c4a7b1e8d3406af5b2c9d1e0f7a83 └┬─┘ └┬─┘ └──────────────┬──────────────┘ │ │ └─ random secret, never shown again │ └─ environment: live or test └─ product: Instafuel partner API

The prefix is readable and stable. The secret is not: it is shown once, at creation. Instafuel only keeps a fingerprint and cannot give it back. Lose it and you rotate the key.

Getting a key

Keys are not self-provisioned: Instafuel issues them when your introducer account is opened, after the partnership agreement is signed.

  1. Ask for the account through your Instafuel contact.

  2. Receive your test key (ifp_test_*). It is immediate and commitment-free: build and validate your whole integration with it.

  3. Ask for the production key (ifp_live_*) once your integration is ready. Instafuel will ask for your servers' outbound IP addresses and the scopes you need, and will hand you the production base URL along with the key.

Scopes

A key only carries the scopes it was granted. Ask for the minimum you need — that is what limits the damage if it leaks.

ScopeAllows
COMPANIES_READread the companies in your portfolio
COMPANIES_WRITErequest a company onboarding, update a record
USERS_READread your clients' web accounts
USERS_WRITEcreate and update web accounts at your clients
WALLET_READread Fuelz balances and follow your payment declarations
LEDGER_READread a wallet's entries
TRANSACTIONS_READread fill-ups
DRIVERS_READread driver wallets — contains personal data
ALERTS_READread alerts for portfolio companies
REPORTS_READread the portfolio summary
CREDIT_REQUEST_WRITEupload proof and declare a payment (never credit directly)

A call outside the key's scopes returns 403 PAPI_SCOPE_MISSING and has no effect. The message names the missing scope, so you know at once what to ask for.

GET /v1/papi/me returns, at any time, the scopes the calling key carries and the ones Instafuel has authorised on your account. You cannot grant yourself a scope beyond that ceiling — key creation refuses it with 422 PAPI_SCOPE_ABOVE_CEILING.

One key per use

Separate things that do not carry the same risk: a read-only key for your internal dashboard, a write key for your onboarding back office. The day one leaks, you revoke it without stopping the rest.

IP restriction

A production key can be limited to a list of outbound IP addresses. A call from any other address is refused with 403 PAPI_IP_FORBIDDEN, even with a valid key.

This is the most effective protection against an exfiltrated key: the secret alone is no longer enough, the call must also come from your infrastructure.

Warn Instafuel before changing hosting provider or adding an egress gateway — otherwise the cut is immediate and total.

Rotation

Rotate production keys at least once a year, and immediately if one may have been exposed: accidental commit, lost laptop, contractor leaving.

Rotation is zero-downtime, provided you keep the order:

  1. Ask for a new key. The old one stays active.

  2. Deploy the new one in your configuration. Check with GET /v1/papi/me that it answers 200 from your production servers.

  3. Run both for a while, long enough for every process to have reloaded its configuration — scheduled jobs and queue workers included, they are usually the last.

  4. Revoke the old one and check that no 401 PAPI_KEY_INVALID shows up in your logs.

Order matters

Revoking before deploying cuts your integration until the next deployment. A revoked key is never reactivated.

Revocation

Ask your Instafuel contact for revocation, quoting the key prefix — never the whole key in an email.

Revocation is immediate and final. Any call presenting the key then returns 401 PAPI_KEY_INVALID.

If a leak is confirmed, revoke first and investigate second: a compromised key gives a complete view of your portfolio and can onboard companies in your name.

Hygiene

  • Store the key in a secret manager, or at least in an environment variable. Never in the repository.
  • Add a filter to your logs: a key copied into a stack trace is a published key.
  • Never send a key by email or chat. Use an encrypted, one-time channel.
  • Log the prefix your outbound calls use (ifp_live_9f2c…). During an incident, you will know which one to revoke.
  • On staging, treat the test key as disposable: a leak costs little there, which is not a reason to expose it.
Last modified on September 2, 2026
AuthenticationBusiness introducer
On this page
  • Anatomy of a key
  • Getting a key
  • Scopes
  • IP restriction
  • Rotation
  • Revocation
  • Hygiene