Skip to content

Authentication

All API requests require authentication using an API key or OAuth 2.0 token.

Include your API key in the Authorization header:

Terminal window
curl https://api.islamicopenfinance.com/api/v1/contracts \
-H "Authorization: Bearer iof_sk_live_abc123..."
TypePrefixEnvironment
Live Secretiof_sk_live_Production
Test Secretiof_sk_test_Sandbox
Publishableiof_pk_Client-side

Via the dashboard or API:

const key = await iof.apiKeys.create({
name: "Production Server",
permissions: ["contracts:*", "kyc:read"],
});

For user-delegated access:

Terminal window
curl https://api.islamicopenfinance.com/api/v1/contracts \
-H "Authorization: Bearer iof_at_abc123..."

See OAuth 2.0 Guide for implementation details.

ScopeAccess
contracts:readRead contracts
contracts:writeCreate/update contracts
contracts:*Full contract access
kyc:readRead KYC data
kyc:writeSubmit verifications
billing:readView billing
admin:*Full admin access
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}
{
"error": {
"code": "FORBIDDEN",
"message": "API key lacks required permissions"
}
}
  1. Never expose secret keys in client-side code
  2. Use environment variables for credentials
  3. Rotate keys regularly (90 days recommended)
  4. Use minimum required scopes
  5. Monitor key usage for anomalies