Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/fmoraga01/SpinAI/llms.txt

Use this file to discover all available pages before exploring further.

SpinAI’s home screen includes a notification button that lets any authenticated team member immediately email the group about who is presenting at the next Friday meeting. This is useful when you want to send a reminder outside the regular Monday schedule, or when you are first setting up the integration and want to confirm everything works.

How it works

When the notification button is clicked on the home screen, SpinAI resolves the next upcoming assignment — the soonest assignment on or after today that has a member assigned — and POSTs its assignmentId to /api/notify. The route then sends an email to the assigned member and CC’s all other active members who have email addresses configured.

API reference

The notification endpoint is available directly if you need to trigger emails from scripts or external tooling.
assignmentId
string
required
The UUID of the assignment to notify about. Must reference an existing assignment with a member assigned to it.
testMode
boolean
When true, the email is sent only to GMAIL_USER with no CC recipients. Defaults to false. Use this to validate your SMTP configuration without notifying the whole team.
POST /api/notify
Content-Type: application/json
Cookie: spinai_token=<your-jwt>
Request body
{
  "assignmentId": "<uuid>",
  "testMode": false
}
Success response
{ "ok": true }
Error responses
StatusErrorCause
401 UnauthorizedUnauthorizedNo spinai_token cookie present, or the JWT is invalid / expired
400 Bad RequestassignmentId requiredThe request body is missing the assignmentId field
404 Not FoundAssignment not foundNo assignment exists with the provided UUID
422 Unprocessableunassigned_slotThe assignment exists but has no member assigned to it
422 Unprocessableno_emailThe assigned member does not have an email address stored
500 Internal Server ErrorGMAIL_USER / GMAIL_PASS not configuredOne or both Gmail SMTP environment variables are missing
500 Internal Server ErrorCould not fetch membersSupabase returned an error when querying the members table
502 Bad GatewayEmail send failedNodemailer attempted to send the email but the Gmail SMTP connection failed

Test mode

Setting testMode: true routes the email exclusively to GMAIL_USER and omits all CC recipients. The subject line is prefixed with [PRUEBA] so you can identify test emails at a glance. Use this mode when verifying your SMTP credentials for the first time or after rotating your Gmail App Password.
The notification button on the home screen always targets the next upcoming assignment — the soonest date on or after today with a member assigned. It is not possible to send a notification for an arbitrary past or future assignment from the UI. Use the API directly with an explicit assignmentId if you need that behaviour.

Example cURL request

curl -X POST https://your-app.vercel.app/api/notify \
  -H "Content-Type: application/json" \
  -H "Cookie: spinai_token=<your-jwt>" \
  -d '{"assignmentId": "<uuid>", "testMode": false}'
Replace <your-jwt> with the value of the spinai_token cookie from your active browser session, and <uuid> with the ID of the assignment you want to notify about.

Prerequisites

Before sending notifications, your Gmail SMTP credentials must be configured. See Email Setup for step-by-step instructions on generating a Gmail App Password and adding it to your environment variables.

Build docs developers (and LLMs) love