Guides
How to build a custom dashboard for syndicators using entity-scoped API keys
This guide shows how to build a syndicator-facing dashboard that displays their portfolio, deal performance, and accounting data — all using a syndicator-scoped API key.
Syndicator-scoped API keys automatically filter all data to deals where the syndicator has participation. You don’t need to filter manually — the API enforces it.
Key concept: Create an API key with entityType: "syndicator" and entityId: "{syndicatorId}". All API responses are automatically scoped to that syndicator’s deals.
entityType: syndicatorentityId: the syndicator’s IDdeals:read, payments:read, accounting:read, collections:readconst API_KEY = 'smca_live_...'; // Syndicator-scoped key
// All deals returned are automatically filtered to this syndicator's participations
const res = await fetch('https://api.smartmca.com/api/public/v1/deals?limit=50', {
headers: { 'Authorization': `Bearer ${API_KEY}` },
});
const { data: deals, meta } = await res.json();
// Display portfolio summary
const totalFunded = deals.reduce((sum, d) => sum + d.fundedAmount, 0);
const totalOutstanding = deals.reduce((sum, d) => sum + d.outstandingBalance, 0);
console.log(`Portfolio: ${deals.length} deals, $${totalFunded} funded, $${totalOutstanding} outstanding`);
async function getDealDetail(dealId) {
const [deal, payments, schedule] = await Promise.all([
fetch(`https://api.smartmca.com/api/public/v1/deals/${dealId}`, {
headers: { 'Authorization': `Bearer ${API_KEY}` },
}).then(r => r.json()),
fetch(`https://api.smartmca.com/api/public/v1/deals/${dealId}/payments?limit=100`, {
headers: { 'Authorization': `Bearer ${API_KEY}` },
}).then(r => r.json()),
fetch(`https://api.smartmca.com/api/public/v1/deals/${dealId}/collection-schedule`, {
headers: { 'Authorization': `Bearer ${API_KEY}` },
}).then(r => r.json()),
]);
return {
deal: deal.data,
recentPayments: payments.data,
collectionSchedule: schedule.data,
};
}
View all accounting entries specific to this syndicator:
// Syndicator subledger — all journal entries for this syndicator's participations
const subledger = await fetch(
`https://api.smartmca.com/api/public/v1/accounting/reports/subledger/syndicator/${syndicatorId}`,
{ headers: { 'Authorization': `Bearer ${API_KEY}` } }
).then(r => r.json());
// Per-deal accounting
const dealAccounting = await fetch(
`https://api.smartmca.com/api/public/v1/deals/${dealId}/accounting/entries`,
{ headers: { 'Authorization': `Bearer ${API_KEY}` } }
).then(r => r.json());
Subscribe to events to keep the dashboard updated:
await fetch('https://api.smartmca.com/api/public/v1/webhooks', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
url: 'https://your-dashboard.com/webhooks',
events: [
'deal.status_changed',
'payment.received',
'payment.failed',
],
description: 'Syndicator dashboard updates',
}),
});
*:read scopes.