MSP Features
Managed Service Provider (MSP) features for multi-tenant management.
Overview
MSP features allow managed service providers to manage multiple client tenancies from a single integration.
Getting MSP Details
typescript
const msp = await client.msp.get('msp-id');
console.log(`MSP: ${msp.name}`);
console.log(`Status: ${msp.status}`);Listing Managed Tenants
typescript
const tenants = await client.msp.listTenants('msp-id');
for (const tenant of tenants) {
console.log(`${tenant.name} - ${tenant.status}`);
}MSPTenant Type
typescript
interface MSPTenant {
id: string;
type: 'msp_tenant';
name: string;
contactEmail: string;
status: 'active' | 'inactive' | 'suspended';
createdAt: Date;
updatedAt: Date;
}Multi-Tenant Operations
When working with multiple tenants, switch context using the organizationId:
typescript
// Create client for specific tenant
const tenantClient = new DeIterateClient({
apiKey: process.env.DEITERATE_API_KEY!,
organizationId: 'tenant-org-id',
});
// Operations now scoped to that tenant
const risks = await tenantClient.risks.list();Best Practices
- Isolate tenant data - Never mix data between tenants
- Use separate tokens - Consider per-tenant API tokens
- Audit access - Log which tenant is being accessed
- Handle permissions - Respect tenant-level permissions
Next Steps
- Configuration - Client configuration options