---
title: "Send a sample event to every target of a rule"
method: POST
path: "/rest/api/v1/projects/{projectId}/notificationRules/test"
tags: ["Notifications API"]
---

# Send a sample event to every target of a rule

`POST /rest/api/v1/projects/{projectId}/notificationRules/test`

## Request

- Base URL: `https://api.metacopier.io`
- URL: `https://api.metacopier.io/rest/api/v1/projects/{projectId}/notificationRules/test`
- Auth: API key in header `X-API-KEY`
- TypeScript: <https://skmtc.dev/metacopier/apis/metacopier-api/docs/rest/api/v1/projects/:projectId/notificationRules/test/post.ts> (a function with typed inputs; its response is checked against the schema)

The rule does not need to be saved. Filters, digest, quiet hours and cooldown are bypassed.

## Path parameters

- `projectId` string, uuid, required

## Request body

- NotificationRuleTestRequestDTO: Unsaved rule plus a sample event to send to its channels
  - `accountId` string, uuid: Optional account used in the sample message
  - `event` 'POSITION_OPENED' | 'POSITION_CLOSED' | 'POSITION_MODIFIED' | 'HISTORY_UPDATED' | 'TRADE_APPROVAL_REQUIRED' | 'TRADE_APPROVED' | 'UNMANAGED_POSITION_DETECTED' | 'COPY_SKIPPED' | 'ORDER_REJECTED' | 'INSUFFICIENT_MARGIN' | 'TRADE_FAILED_DISCONNECTED' | 'COPY_FAILED' | 'DUPLICATE_POSITION_DETECTED' | 'ACCOUNT_STARTED' | 'ACCOUNT_STOPPED' | 'ACCOUNT_CONNECTED' | 'ACCOUNT_DISCONNECTED' | 'ACCOUNT_LOGIN_FAILED' | 'ACCOUNT_TOKEN_EXPIRING' | 'ACCOUNT_RESTRICTED' | 'ACCOUNT_FALLBACK_MODE' | 'RISK_LIMIT_REACHED' | 'PROFIT_TARGET_REACHED' | 'LOSS_PROTECTED_EXIT' | 'GUARDRAIL_TRIGGERED' | 'COPIER_STOPPED_BY_RISK' | 'LIMIT_RESET' | 'BALANCE_ADJUSTMENT_DETECTED' | 'NEWS_EVENT_UPCOMING' | 'NEWS_EVENT_RELEASED' | 'NEWS_FILTER_ACTION_SCHEDULED' | 'NEWS_FILTER_ACTION_IMMINENT' | 'NEWS_FILTER_DAILY_AGENDA' | 'NEWS_FILTER_SKIPPED_COPY' | 'NEWS_FILTER_CLOSED_POSITION' | 'NEWS_FILTER_REOPENED' | 'NEWS_FILTER_REOPEN_SKIPPED' | 'NEWS_FILTER_HOLIDAY_MODE' | 'MARKET_NEWS_HIGH_IMPACT' | 'SIGNAL_RECEIVED' | 'SIGNAL_EXECUTED' | 'SIGNAL_REJECTED' | 'SIGNAL_AI_LIMIT_REACHED' | 'SIGNAL_SUBSCRIPTION_ENDED' | 'CONFIGURATION_ERROR' | 'CONFIGURATION_CHANGED' | 'MAINTENANCE_WINDOW' | 'PROXY_ISSUE' | 'EXPERT_ADVISOR_STARTED' | 'EXPERT_ADVISOR_STOPPED' | 'EXPERT_ADVISOR_WARNING' | 'LOG_RATE_LIMITED' | 'NOTIFICATION_CHANNEL_DISABLED' | 'GENERAL': Sample event, default POSITION_OPENED
  - `rule` FeatureNotificationRuleDTO: Notification rule (feature type 58): which log events go to which channels
    - `accountIds` string[]: Only these accounts; empty = all accounts including future ones
    - `categories` string[]: Categories; empty = all
    - `cooldown` NotificationCooldownDTO: Suppresses repeats of the same message for a while
      - `enabled` boolean: Cooldown on/off
      - `minutes` integer: Cooldown length, 1 to 1440 minutes
    - `digest` NotificationDigestDTO: Bundles messages of a rule: the first is sent, further ones within the window become one summary
      - `enabled` boolean: Digest on/off
      - `errorsImmediate` boolean: Never bundle ERROR messages
      - `windowSeconds` integer: Window length, 10 to 3600 seconds
    - `enabled` boolean: Rule on/off
    - `events` string[]: Fine grained events; empty = all events of the selected categories
    - `excludeAccountIds` string[]: All accounts except these; cannot be combined with accountIds
    - `includeProjectEvents` boolean: With accountIds: still deliver events that belong to no account
    - `kind` string: Setting discriminator, always RULE
    - `migratedFromFeatureId` string, uuid: Set when the rule was created from a legacy Telegram notification
    - `minLogLevel` LogTypeDTO, required: Lowest level delivered: 1 = ERROR, 2 = WARN, 3 = INFO
      - `id` integer, required
      - `name` string
    - `name` string, required: Free label of the rule
    - `quietHours` NotificationQuietHoursDTO: Suppresses deliveries of a rule during a daily time window
      - `activeDays` integer[]: Days the window starts on, 1 = Monday ... 7 = Sunday; empty = daily
      - `after` string: What happens at the end: SUMMARY or DISCARD
      - `allowErrors` boolean: ERROR messages are still delivered
      - `enabled` boolean: Quiet hours on/off
      - `from` string: Start, HH:mm, inclusive
      - `timeZone` string: IANA time zone
      - `to` string: End, HH:mm, exclusive; may span midnight
    - `sourceFeatureIds` string[]: Only events raised by these feature instances; empty = all
    - `sourceFeatureTypeIds` integer[]: Only events raised by these feature types (tools); empty = all
    - `targets` NotificationTargetDTO[]: Channels to deliver to; recipient only for Telegram
      - `featureId` string, uuid: Id of the channel feature instance, for example the project's Telegram feature
      - `recipient` string: Null means every recipient of that channel. Telegram: the username. Email: the address. Slack, Discord, Teams and webhook always leave this null.
    - `useAlias` boolean: Show the account alias instead of the account id

## Response `200`

OK

- NotificationRuleTestResultDTO: Per channel result of a rule test
  - `results` NotificationDeliveryResultDTO[]: Results
    - `channelType` 'TELEGRAM' | 'WEBHOOK' | 'SLACK' | 'MS_TEAMS' | 'DISCORD': Channel type
    - `deliveryId` string: Id in the delivery log
    - `error` string: Sanitized provider error
    - `featureId` string, uuid: Channel feature
    - `recipient` string: Recipient (Telegram)
    - `status` 'QUEUED' | 'ACCEPTED' | 'FAILED' | 'UNKNOWN' | 'BUNDLED' | 'QUIET' | 'COOLDOWN' | 'DROPPED_OVERFLOW' | 'DROPPED_RATE_LIMIT' | 'EXPIRED' | 'SKIPPED_DISABLED' | 'SKIPPED_TARGET' | 'CANCELLED_CONFIG_CHANGED': ACCEPTED, FAILED, UNKNOWN (timeout, may still arrive) or a SKIPPED_* status

## Changes

- **2026-11-02** `2ac6d7461345`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/metacopier/apis/metacopier-api/changes/rest/api/v1/projects/:projectId/notificationRules/test/post.md)

---

[API](https://skmtc.dev/metacopier/apis/metacopier-api.md) - [All operations](https://skmtc.dev/metacopier/apis/metacopier-api/llms.txt) - [OpenAPI document](https://skmtc.dev/metacopier/apis/metacopier-api/revisions/2ac6d7461345?raw)
