When an event is sent
Parmana sends one event when all of these hold:- The request was refused by the policy’s own rules, or because an attached approval did not verify.
- The policy declares
approvalSignals. - Evaluating the same policy, with every declared approval signal set to
true, authorizes the request.
Add Resend to the Vercel project
npx vercel link:RESEND_API_KEY and
RESEND_EMAIL_DOMAIN on the project. Use a subdomain, such as notify.example.com, so its
records cannot affect other mail on your domain.Verify the domain
TXT record at
resend._domainkey.notify, and an MX and a TXT (SPF) record at send.notify. Add them
at your DNS provider. Emails are refused until the domain shows Verified in Resend.Name the recipients
Parmana approvals <approvals@<RESEND_EMAIL_DOMAIN>>, or from
APPROVAL_EMAIL_FROM if you set it. A missing Resend key, a missing sender, or an address that
is not valid stops the server at startup, so a broken setup cannot fail silently.
A notification email looks like this:
approval-needed/<decisionId>, so a retried send is not delivered twice. Delivery follows the
same rules as the webhook: one attempt, a failure is logged and never changes the refusal.
Webhook
Set it up
Create an endpoint
POST and answers 2xx within 3 seconds: a small
function of your own, a Slack workflow webhook behind a relay, or an automation service.Generate a secret
Configure Parmana
PARMANA_SECRETS_PROVIDER=aws-secrets-manager, APPROVAL_WEBHOOK_SECRET is the name or
ARN of the secret instead of its value. Setting only one of the two stops the server at
startup. The URL must be https outside NODE_ENV=test and development.Send a test request
managerApproved: false and every other fact true. Your endpoint receives an event.The event
approval.needed.paytm:refund. Sign with this as
capability.businessTransactionId if you need them.
Verify the signature
Every event has two headers:From event to approval
The approver signs exactly what the event names:businessTransactionId, the approval signal set
to true, and the approval in signals.approvalArtifact. See
Human approval.
Delivery
Test locally
Point the webhook at a local listener and run Parmana in development:http is accepted only in development and test.