Portal Community

Live Mockup

Delete All Test Records?

This will permanently delete 1,432 test records from the staging database. This action cannot be undone.

Confirmation Payload Schema

interface ConfirmationPayload {
  /** Main message to display */
  message: string;

  /** Label for the confirm button (default: "Confirm") */
  confirmLabel?: string;

  /** Label for the cancel button (default: "Cancel") */
  cancelLabel?: string;

  /** Severity affects icon and color: "info" | "warning" | "danger" (default: "warning") */
  severity?: 'info' | 'warning' | 'danger';

  /** Show a third option (e.g., "Remind Me Later") */
  thirdOption?: {
    label: string;
    outcome: string; // the outcome string when this button is clicked
  };
}

Response Schema

// Outcomes: "confirmed" | "cancelled" | custom (from thirdOption.outcome)
// respond("confirmed") — user clicked the confirm button
// respond("cancelled") — user clicked cancel
// respond("remind-later") — user clicked the third option (if configured)

Usage Example

// Server — send a confirmation interaction
var request = new InteractionRequest {
  Type = InteractionTypes.Confirmation,
  TargetUserId = currentUserId,
  Title = "Delete All Test Records?",
  Payload = new ConfirmationPayload {
    Message = "This will permanently delete 1,432 test records. This cannot be undone.",
    ConfirmLabel = "Yes, Delete All",
    CancelLabel = "Cancel",
    Severity = "danger"
  },
  TimeoutMs = 300_000 // 5 minutes
};

var response = await _publisher.PublishAndWaitAsync(request, ct);
if (response.Outcome == "confirmed")
{
    await _dataService.DeleteAllTestRecordsAsync(ct);
}

Severity Variants

SeverityIconColorUse Case
infoinfo circleBlueNeutral confirmations, informational dialogs
warningtriangle warningYellowPotentially impactful actions (default)
dangeroctagon exclamationRedDestructive, irreversible actions
Approval vs. Confirmation Use approval when a manager or designated approver needs to authorize a business action. Use confirmation when the user who initiated an action needs to confirm it. Confirmations are self-targeted; approvals are other-targeted.