Skip to content

Authentication

FluxiQ Core uses JWT (JSON Web Token) authentication for API access. All API requests must include a valid access token in the Authorization header.

Overview

MethodUse CaseToken Lifetime
API KeyServer-to-server (merchants)No expiry (revocable)
JWTUser sessions (banking, admin)15 minutes (access) + 7 days (refresh)

API Key Authentication

For merchant integrations, use API keys:

http
GET /api/v1/accounts
Authorization: Bearer sk_live_abc123def456
Content-Type: application/json

Generate API Key

http
POST /api/v1/merchants/{merchant_id}/api-keys
Authorization: Bearer {admin_jwt_token}
Content-Type: application/json

{
  "name": "Production Key",
  "permissions": ["accounts:read", "pix:write", "transfers:write"]
}

Response:

json
{
  "data": {
    "id": "key_01HQGX...",
    "name": "Production Key",
    "key": "sk_live_abc123def456ghi789",
    "permissions": ["accounts:read", "pix:write", "transfers:write"],
    "created_at": "2026-02-03T12:00:00Z"
  }
}

WARNING

The full API key is only shown once at creation time. Store it securely.

JWT Authentication

For user-facing applications (banking UI, admin console):

Login

http
POST /api/v1/auth/login
Content-Type: application/json

{
  "document": "12345678901",
  "password": "your-password"
}

Response:

json
{
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIs...",
    "refresh_token": "eyJhbGciOiJIUzI1NiIs...",
    "token_type": "Bearer",
    "expires_in": 900
  }
}

Using the Token

http
GET /api/v1/accounts
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
Content-Type: application/json

Refresh Token

http
POST /api/v1/auth/refresh
Content-Type: application/json

{
  "refresh_token": "eyJhbGciOiJIUzI1NiIs..."
}

Logout

http
POST /api/v1/auth/logout
Authorization: Bearer {access_token}

Permissions (RBAC)

RoleDescriptionPermissions
ownerFull access to all resources*
managerManage accounts, view transactionsaccounts:*, transactions:read, pix:*
operatorExecute transactions, view accountsaccounts:read, transactions:read, pix:write

Permission Scopes

ScopeDescription
accounts:readView account balances and details
accounts:writeCreate and update accounts
pix:readView PIX transactions
pix:writeSend and receive PIX payments
transfers:readView internal transfers
transfers:writeExecute internal transfers
webhooks:readView webhook configurations
webhooks:writeCreate and manage webhooks
users:readView user profiles
users:writeManage user accounts

Rate Limiting

MethodLimitWindow
API Key1,000 req/minPer key
JWT100 req/minPer user
Unauthenticated10 req/minPer IP

Rate limit headers are included in all responses:

http
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 997
X-RateLimit-Reset: 1706961600

Error Responses

401 Unauthorized

json
{
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired authentication token"
  }
}

403 Forbidden

json
{
  "error": {
    "code": "FORBIDDEN",
    "message": "Insufficient permissions for this operation",
    "required_permission": "pix:write"
  }
}

429 Too Many Requests

json
{
  "error": {
    "code": "RATE_LIMITED",
    "message": "Rate limit exceeded. Retry after 30 seconds",
    "retry_after": 30
  }
}

FluxiQ Core - PIX Payment Gateway