API ReferenceWooCommerceSDKssoonWebhookssoon

Email

Update the claim email template

PUT/api/merchants/email-template

Save a new claim email template. The body is validated against the template schema and unknown fields are stripped.

  • Send the same object shape GET /api/merchants/email-template returns. A 400 response names the offending field.
  • Companion routes exist for the dashboard's Email Studio: POST /api/merchants/email-template/preview renders a draft, /test sends it to your own address, /reset restores the default, and /ai edits it from an instruction.

Authentication

Accepts either an API key (X-API-Key) or a dashboard JWT (Authorization: Bearer …).

PUT/api/merchants/email-template
curl --request PUT "https://api.trevi.cash/api/merchants/email-template" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: $TREVI_API_KEY" \
  --data '{ "subject": "Your cashback from {{merchant_name}}" }'