Portal Community

When to Use

Live Mockup — Danger Confirmation

⚠️

Delete All Test Records

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

Live Mockup — Ternary (Third Option)

📥

Deploy to Production?

Build v3.2.1 has passed all staging checks. Would you like to deploy to production now or schedule for off-hours?

Severity Levels

info warning danger

The severity field controls the visual styling of the confirmation dialog. Use danger for destructive actions, warning for consequential ones, and info (default) for neutral confirmations.

Request Payload Schema

interface ConfirmationPayload {
  /** The question or warning message shown to the user */
  message: string;

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

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

  /** Visual severity: 'info' | 'warning' | 'danger' (default: 'info') */
  severity?: 'info' | 'warning' | 'danger';

  /** Optional third option (e.g., "Schedule", "Remind me later") */
  thirdOption?: {
    label:   string;   // button label
    outcome: string;   // outcome string returned when clicked
  };
}

Full Request Example (Ternary)

const response = await sendInteraction({
  type: 'confirmation',
  targetUserId: currentUserId,
  title: 'Deploy to Production?',
  payload: {
    message: 'Build v3.2.1 has passed all staging checks. Deploy to production now or schedule for off-hours?',
    confirmLabel: 'Deploy Now',
    cancelLabel: 'Cancel',
    severity: 'warning',
    thirdOption: {
      label:   'Schedule',
      outcome: 'scheduled'
    }
  },
  timeoutMs: 120_000   // 2 minutes
});

switch (response.outcome) {
  case 'confirmed':  await deployNow(buildId); break;
  case 'scheduled':  await scheduleDeploy(buildId); break;
  case 'cancelled':  /* do nothing */ break;
}

Response Schema

interface ConfirmationResponse {
  interactionId: string;
  respondedBy:   string;
  outcome:       'confirmed' | 'cancelled' | string;   // 'string' for thirdOption outcomes
  data:          {};   // empty for confirmation type
  timestamp:     string;
}

Validation Rules

FieldRule
payload.messageRequired, max 2000 characters
payload.confirmLabelOptional, max 50 characters
payload.cancelLabelOptional, max 50 characters
payload.severityOptional; must be one of: info, warning, danger
payload.thirdOption.outcomeMust not be 'confirmed' or 'cancelled' (reserved)
response.outcomeMust be 'confirmed', 'cancelled', or a registered thirdOption outcome
Self-Targeting is Common Confirmation interactions are often sent to the same user who triggered the action — targetUserId: currentUserId. This creates a blocking "are you sure?" step where the action only executes after the user explicitly confirms.