digitaltrendz.dev
API Reference
All routes are relative to https://digital-trendz.net or https://digitaltrendz.dev
Auth
● Public● API Key● Session● AdminAI Agent
/api/ai-agent
/api/ai-agentPublicSend a message to the DT AI assistant. Supports conversation history via x-session-id header.
Body: { message: string }
⚠ Session-based; pass x-session-id for multi-turn conversations.
Contact & Lead Forms
/api/contact
/api/contactPublicSubmit a general contact form. Sends email via Resend.
Body: { name, email, message, phone? }
/api/case-study-requestPublicRequest access to a specific case study.
Body: { name, email, company, caseStudyId }
/api/download-requestPublicRequest a downloadable asset (whitepaper, report).
Body: { name, email, assetId }
/api/speaker-applicationPublicSubmit a speaker application for events.
Body: { name, email, bio, topic }
/api/webinar-accessPublicRequest access to a webinar recording or live event.
Body: { name, email, webinarId }
/api/whitepaper-requestPublicRequest a whitepaper download link.
Body: { name, email, whitepaperSlug }
/api/resumePublicSubmit a job application with CV.
Body: { name, email, role, message }
/api/emails
/api/emailsSessionList emails from the connected Resend inbox.
/api/emails/sendSessionSend a transactional email via Resend.
Body: { to, subject, html }
/api/emails/resendSessionResend a previously sent email by ID.
Body: { emailId: string }
/api/emails/templatesSessionFetch available email templates.
/api/emails/actionsSessionPerform an action on an email (archive, mark read, etc).
Body: { emailId, action }
Blog & Content
/api/blog
/api/blog/articlesPublicList published blog articles. Supports ?limit and ?category query params.
/api/blog/generateAdminTrigger AI generation of a blog draft (cron-callable).
Auth
/api/auth
/api/auth/userSessionReturn the currently authenticated user profile.
/auth/callbackPublicSupabase OAuth callback handler. Do not call directly.
⚠ Used internally by Supabase Auth redirect flow.
Webhooks
/api/webhooks
/api/webhooks/resendPublicReceives Resend webhook events (email.sent, email.delivered, email.bounced, etc).
⚠ Verify via Resend-Signature header. Bypasses auth middleware.
AI Gateway
/api/v1
/api/v1/gateway/chatAPI KeyUnified chat completion gateway. Routes to OpenAI or other providers based on model param.
Body: { model, messages[], stream? }
Admin
/api/admin
/api/admin/keysAdminList active API keys.
/api/admin/keysAdminCreate a new API key.
Body: { label, scopes[] }
/api/admin/universalAdminUniversal admin action endpoint for CMS operations.
Body: { action, payload }
Cron
/api/cron
/api/cron/blog-generationAdminScheduled blog post generation job. Called by Vercel Cron, not directly.
⚠ Protected by CRON_SECRET env var.