digitaltrendz.dev

API Reference

All routes are relative to https://digital-trendz.net or https://digitaltrendz.dev

Auth

PublicAPI KeySessionAdmin

AI Agent

/api/ai-agent

POST/api/ai-agentPublic

Send 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

POST/api/contactPublic

Submit a general contact form. Sends email via Resend.

Body: { name, email, message, phone? }

POST/api/case-study-requestPublic

Request access to a specific case study.

Body: { name, email, company, caseStudyId }

POST/api/download-requestPublic

Request a downloadable asset (whitepaper, report).

Body: { name, email, assetId }

POST/api/speaker-applicationPublic

Submit a speaker application for events.

Body: { name, email, bio, topic }

POST/api/webinar-accessPublic

Request access to a webinar recording or live event.

Body: { name, email, webinarId }

POST/api/whitepaper-requestPublic

Request a whitepaper download link.

Body: { name, email, whitepaperSlug }

POST/api/resumePublic

Submit a job application with CV.

Body: { name, email, role, message }

Email

/api/emails

GET/api/emailsSession

List emails from the connected Resend inbox.

POST/api/emails/sendSession

Send a transactional email via Resend.

Body: { to, subject, html }

POST/api/emails/resendSession

Resend a previously sent email by ID.

Body: { emailId: string }

GET/api/emails/templatesSession

Fetch available email templates.

POST/api/emails/actionsSession

Perform an action on an email (archive, mark read, etc).

Body: { emailId, action }

Blog & Content

/api/blog

GET/api/blog/articlesPublic

List published blog articles. Supports ?limit and ?category query params.

POST/api/blog/generateAdmin

Trigger AI generation of a blog draft (cron-callable).

Auth

/api/auth

GET/api/auth/userSession

Return the currently authenticated user profile.

GET/auth/callbackPublic

Supabase OAuth callback handler. Do not call directly.

Used internally by Supabase Auth redirect flow.

Webhooks

/api/webhooks

POST/api/webhooks/resendPublic

Receives Resend webhook events (email.sent, email.delivered, email.bounced, etc).

Verify via Resend-Signature header. Bypasses auth middleware.

AI Gateway

/api/v1

POST/api/v1/gateway/chatAPI Key

Unified chat completion gateway. Routes to OpenAI or other providers based on model param.

Body: { model, messages[], stream? }

Admin

/api/admin

GET/api/admin/keysAdmin

List active API keys.

POST/api/admin/keysAdmin

Create a new API key.

Body: { label, scopes[] }

POST/api/admin/universalAdmin

Universal admin action endpoint for CMS operations.

Body: { action, payload }

Cron

/api/cron

GET/api/cron/blog-generationAdmin

Scheduled blog post generation job. Called by Vercel Cron, not directly.

Protected by CRON_SECRET env var.