#639 — [Out of Scope/ can be done manual] Email Configuration API Endpoints

Repo: Twill-AI/facade State: open | Status: open Assignee: sparsh-twillpayments

Created: 2025-10-08 · Updated: 2025-10-13

Description

Create API endpoints for partners to configure email sending domain, initiate SendGrid authentication, and verify DNS records. AC:

  • POST /api/v1/partner/whitelabel/email/setup - Initialize email config

    • Requires PartnerGrantedFor() authentication
    • Accepts domain, from_email, from_name, reply_to_email
    • Calls SendGridDomainManager.create_authenticated_domain()
    • Returns DNS records partner must add
    • Creates partner_email_config record
  • GET /api/v1/partner/whitelabel/email/dns-records - Get DNS records

    • Returns current DNS records for partner’s domain
    • Includes verification status for each record
  • POST /api/v1/partner/whitelabel/email/verify - Verify DNS setup

    • Calls SendGridDomainManager.verify_domain()
    • Updates verification flags in database
    • Returns verification status and any errors
  • GET /api/v1/partner/whitelabel/email/status - Get email config status

    • Returns current email configuration
    • Includes authentication and verification status
    • Shows from_email, from_name, verification timestamps
  • POST /api/v1/partner/whitelabel/email/test - Send test email

    • Sends test email to partner’s email address
    • Uses partner branding and from_email
    • Verifies end-to-end email sending works
  • All endpoints have proper error handling

  • Rate limiting on verify endpoint (max 1 req/5min)

  • Tests for all endpoints

Notes

Add implementation notes, blockers, and context here

Add wikilinks to related people, meetings, or other tickets