wulf-pulse/app/api/openclaw/sync/zoom/route.ts
lorentz 5be7b22953 feat: OpenClaw external agent sync API at /api/openclaw/*
- API key auth via x-openclaw-key header (OPENCLAW_API_KEY env var)
- GET  /api/openclaw/sync/status
- POST /api/openclaw/sync/autotask/incremental
- POST /api/openclaw/sync/autotask/full
- POST /api/openclaw/sync/autotask/entity   { entities: [...] }
- POST /api/openclaw/sync/datto-rmm          { syncType: full|incremental }
- POST /api/openclaw/sync/sentinelone
- POST /api/openclaw/sync/veeam              { syncType: full|incremental }
- POST /api/openclaw/sync/zoom
- POST /api/openclaw/sync/engagement
- POST /api/openclaw/sync/qbo                { syncType: full|incremental }
- POST /api/openclaw/sync/zabbix
- POST /api/openclaw/sync/itglue
All routes bypass Better Auth middleware, delegate to existing sync services
2026-03-17 23:26:44 -04:00

31 lines
1 KiB
TypeScript

import { NextRequest, NextResponse } from 'next/server';
import { validateOpenClawKey } from '@/lib/utils/openclaw-auth';
import { getZoomSyncService } from '@/lib/services/zoom-sync-service';
import { isZoomConfigured } from '@/lib/services/zoom-factory';
export async function POST(request: NextRequest) {
const authError = validateOpenClawKey(request);
if (authError) return authError;
if (!isZoomConfigured()) {
return NextResponse.json({ error: 'Zoom credentials not configured' }, { status: 503 });
}
try {
const service = getZoomSyncService();
if (service.isSyncInProgress()) {
return NextResponse.json({ error: 'Zoom sync already in progress' }, { status: 409 });
}
service.sync().catch((err) => console.error('[OpenClaw] Zoom sync failed:', err));
return NextResponse.json({
message: 'Zoom sync started',
triggeredBy: 'openclaw',
});
} catch (error) {
const msg = error instanceof Error ? error.message : String(error);
return NextResponse.json({ error: msg }, { status: 500 });
}
}