INFRA Connect
INFRA Connect lets you request user consent directly via API — no OAuth redirect required. The user receives an in-app notification to approve or deny.
How it works#
- Request Consent — POST to /connect/request with the user's INFRA ID and the scopes you need.
- User Gets Notified — The user receives a push notification in the INFRA mobile app with your request details.
- User Approves or Denies — User reviews and approves or denies the request in-app.
- Poll for Result — Poll GET /connect/result/:requestId or receive a consent.granted webhook.
Request consent#
const response = await fetch(
'https://api.infraidentity.com/api/v1/connect/request',
{
method: 'POST',
headers: {
'Authorization': `Basic ${btoa(`${clientId}:${clientSecret}`)}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
infra_user_id: 'usr_01HXYZ...',
scopes: ['profile:basic', 'kyc:status'],
callback_url: 'https://yourapp.com/webhooks/infra',
}),
}
);
// Response
{
"request_id": "req_01HXYZ...",
"status": "pending",
"expires_in": 300
}
Poll for the result#
const result = await fetch(
`https://api.infraidentity.com/api/v1/connect/result/${requestId}`,
{
headers: {
'Authorization': `Basic ${btoa(`${clientId}:${clientSecret}`)}`,
},
}
);
// Response when approved
{
"request_id": "req_01HXYZ...",
"status": "approved",
"user_id": "usr_01HXYZ...",
"granted_scopes": ["profile:basic", "kyc:status"],
"access_token": "eyJ..."
}