API Documentation
REST-based API for LegalMint AI platform
/apiSupabase Auth cookies
application/jsonEndpoints
/api/email/welcomeSend a welcome email after signing up
Request Body:
{
"email": "string",
"name": "string"
}/api/auth/delete-accountDelete user profile and user auth account along with all associated data
/api/auth/logoutSign out the authenticated user and redirect to login
/api/documents/generateGenerate a new legal document using NVIDIA NIM / Groq AI models
Request Body:
{
"businessProfileId": "uuid",
"templateId": "uuid",
"title": "string"
}/api/documents/exportExport an existing legal document to PDF, DOCX, HTML, or Markdown
Request Body:
{
"documentId": "uuid",
"title": "string",
"content": "string",
"format": "DOCX|HTML|MARKDOWN|PDF"
}/api/billing/create-payment-linkCreate a Cashfree payment link for subscription plan upgrades
Request Body:
{
"planId": "string",
"customerEmail": "string",
"customerPhone": "string (optional)",
"customerName": "string (optional)"
}Webhooks
/api/webhooks/cashfreeReceives payment and subscription events from Cashfree. Validates HMAC-SHA256 signature using `CASHFREE_WEBHOOK_SECRET`.