REST API
Nexus exposes a RESTful API for triggering webhook events, managing BOM imports, and controlling user data.
https://nexus-integration.vercel.app/api/api/integrations/webhook/triggerAUTH REQUIREDTrigger a webhook event for a specific integration. Creates an activity log entry and broadcasts a real-time event via Pusher.
Request Body
{
"integrationId": "sap-erp",
"event": "inventory.sync.completed",
"payload": {
"records_processed": 1247,
"sync_type": "incremental"
}
}Response
{
"success": true,
"log": {
"id": 42,
"integration_id": "sap-erp",
"event": "inventory.sync.completed",
"status": "success",
"duration": "245ms",
"created_at": "2026-02-13T09:30:00Z"
}
}/api/bomAUTH REQUIREDUpload and persist a validated BOM import. Stores the file metadata and parsed row data for later retrieval.
Request Body
{
"filename": "components_q1.csv",
"totalRows": 150,
"validRows": 142,
"invalidRows": 5,
"warningRows": 3,
"data": [...]
}Response
{
"success": true,
"import": {
"id": 7,
"filename": "components_q1.csv",
"total_rows": 150,
"created_at": "2026-02-13T10:00:00Z"
}
}/api/bomAUTH REQUIREDRetrieve all BOM imports for the authenticated user, ordered by most recent.
Response
{
"imports": [
{
"id": 7,
"filename": "components_q1.csv",
"total_rows": 150,
"valid_rows": 142,
"created_at": "2026-02-13T10:00:00Z"
}
]
}/api/user/resetAUTH REQUIREDReset all user data and re-seed with demo data. Useful for returning to a known state.
Response
{
"success": true,
"message": "Data reset and demo data re-seeded"
}/api/user/clearAUTH REQUIREDClear all user data without re-seeding. Leaves the dashboard in a clean, empty state.
Response
{
"success": true,
"message": "All data cleared"
}/api/auth/magic-linkSend a passwordless login link to the specified email address. Link expires in 10 minutes.
Request Body
{
"email": "user@company.com"
}Response
{
"success": true,
"message": "Magic link sent"
}Authentication
Most endpoints require authentication via a NextAuth.js session cookie. When making requests from the browser, the session cookie is automatically included. For programmatic access, use the API Playground.