> ## Documentation Index
> Fetch the complete documentation index at: https://www.ravion.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Test-send a notification rule

> Run a sample event or an existing platform event through a notification rule's WHEN/IF matching and, when it matches, attempt delivery to each of the…



## OpenAPI

````yaml https://api.ravion.com/openapi.yaml post /notification-rules/{id}/test-send
openapi: 3.0.0
info:
  title: Ravion
  version: 0.0.0
servers:
  - url: https://api.ravion.com
security:
  - BearerAuth: []
tags:
  - name: Projects
  - name: Environments
  - name: FeatureFlags
  - name: Pipelines
  - name: PipelineRuns
  - name: TerraformResources
  - name: TerraformExecutionSummaries
  - name: PipelineStepExecutions
  - name: AwsCloudWatch
  - name: AwsAmp
  - name: PipelineVersions
  - name: Organizations
  - name: Stacks
  - name: StackWorkspaces
  - name: Auth
  - name: OAuth
  - name: User
  - name: Health
  - name: Memberships
  - name: ServiceAccounts
  - name: Integrations
  - name: AwsDefaultNetworks
  - name: AwsAccounts
  - name: ApiKeys
  - name: EksPrometheus
  - name: EksLoki
  - name: ExecutionEnvironments
  - name: ModuleDefinitions
  - name: ModuleCategories
  - name: ModuleVersions
  - name: ModuleInstances
  - name: DefaultValueDefinitions
  - name: DefaultValues
  - name: CodeSources
  - name: Github
  - name: GitHub Actions
  - name: Alerts
  - name: Gitlab
  - name: Slack
  - name: Git
  - name: MergeQueues
  - name: Values
  - name: Deployments
  - name: DeploymentResources
  - name: InfrastructureEvents
  - name: WebSocket
  - name: Domains
  - name: AcmCertificates
  - name: NotificationDestinations
  - name: NotificationDispatches
  - name: NotificationEvents
  - name: NotificationRules
  - name: Activity
  - name: Describe
  - name: Reports
  - name: BillingPlans
  - name: BillingAccounts
  - name: BillingCycles
  - name: BillingUsageSummaries
  - name: BillingAddOns
  - name: BillingInvoices
  - name: Authorization
  - name: Sandboxes
  - name: SandboxCommands
  - name: SandboxPorts
  - name: Apps
paths:
  /notification-rules/{id}/test-send:
    post:
      tags:
        - NotificationRules
      summary: Test-send a notification rule
      description: >-
        Run a sample event or an existing platform event through a notification
        rule's WHEN/IF matching and, when it matches, attempt delivery to each
        of the rule's destination audiences, whether a webhook, a Slack channel,
        a Slack DM or an email. Each destination gets one message for the event,
        whatever the rule's VIA mode. Computed audiences are not resolved.
        Delivered dispatches are recorded without a rule id, keeping them out of
        the evidence trail for a rule that actually fired live. Available to
        organizations with notifications enabled; refused with 403 otherwise.
      operationId: TestSendNotificationRule
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                data:
                  $ref: '#/components/schemas/NotificationRule.TestSendRequest'
              required:
                - data
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                additionalProperties: false
                properties:
                  data:
                    $ref: '#/components/schemas/NotificationRule.TestSendResult'
                required:
                  - data
                type: object
          description: The request has succeeded.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The request is invalid or malformed.
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You are not authenticated
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: You do not have permission to access this resource.
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: The server cannot find the requested resource.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Client error
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Errors.UserFacingErrorData'
          description: Server error
components:
  schemas:
    NotificationRule.TestSendRequest:
      additionalProperties: false
      description: >-
        Request body for a notification rule test-send. Provide exactly one of
        `platformEventId` or `sampleEvent`.
      properties:
        platformEventId:
          description: Id of an existing PlatformEvent row to replay through the rule.
          type: string
        sampleEvent:
          allOf:
            - $ref: '#/components/schemas/NotificationRule.SampleEvent'
          description: >-
            Ad-hoc sample event to test the rule against — the alternative to
            `platformEventId`.
      type: object
    NotificationRule.TestSendResult:
      additionalProperties: false
      description: >-
        Result of running a test-send's event through a notification rule's
        WHEN/IF matching and, for every audience it matches, an attempted
        delivery.
      properties:
        audienceResults:
          description: Per-audience delivery attempt. Empty when `matched` is false.
          items:
            $ref: '#/components/schemas/NotificationRule.TestSendAudienceResult'
          type: array
        catalogId:
          description: Catalog id evaluated against the rule's WHEN clause.
          type: string
        conditionResults:
          description: >-
            Per-condition IF evaluation. Empty when `eventIdMatched` is false —
            conditions are not evaluated outside a WHEN match.
          items:
            $ref: '#/components/schemas/NotificationRule.TestSendConditionResult'
          type: array
        eventId:
          description: >-
            Id of the event evaluated: the given `platformEventId`, or a
            generated id standing in for the sample event.
          type: string
        eventIdMatched:
          description: Whether the rule's WHEN clause matched the event's catalog id.
          type: boolean
        matched:
          description: >-
            Whether the rule matched overall: `eventIdMatched` AND every
            condition matched.
          type: boolean
      required:
        - eventId
        - catalogId
        - eventIdMatched
        - conditionResults
        - matched
        - audienceResults
      type: object
    Errors.UserFacingErrorData:
      additionalProperties: false
      description: |-
        User-facing error presentation data.
        This is what the API returns to the frontend after formatting ErrorData
        using CEL templates from the error registry.

        Used for both:
        - Error fields on domain models (e.g., PipelineRun.error)
        - API error response bodies (HTTP 4xx/5xx responses)
      properties:
        action:
          allOf:
            - $ref: '#/components/schemas/Errors.Action'
          description: Optional action to help resolve the error
        code:
          description: Full error code, e.g., "Ravion:Pipeline:NOT_FOUND"
          type: string
        description:
          description: Additional description with more details
          type: string
        details:
          description: Structured details rendered as user-facing sections.
          items:
            $ref: '#/components/schemas/Errors.UserFacingErrorDetailSection'
          type: array
        isInternal:
          description: >-
            Indicates whether this error is internal (only set when
            ShowInternal=true).

            This allows SUPERADMINs to identify internal errors while viewing
            full details.
          type: boolean
        message:
          description: Main error message (required)
          type: string
        metadata:
          additionalProperties: {}
          description: >-
            Error params/metadata. Stripped for internal errors unless
            superadmin.
          type: object
        requestId:
          description: Request ID for correlating errors with server logs.
          type: string
      required:
        - code
        - message
      type: object
    NotificationRule.SampleEvent:
      additionalProperties: false
      description: >-
        An ad-hoc event to test a rule against, when no existing platform event
        fits.
      properties:
        catalogId:
          description: >-
            Catalog id the sample pretends to be, matched against the rule's
            WHEN clause exactly as a real event's catalog id would be.
          minLength: 1
          type: string
        payload:
          additionalProperties: {}
          description: >-
            Sample payload evaluated against the rule's IF payload/scope
            conditions.
          type: object
        subjectId:
          description: >-
            Entity id the sample claims as its subject, for scope condition
            matching.
          type: string
        subjectType:
          description: >-
            Entity kind the sample claims as its subject, for scope condition
            matching (e.g. "Project").
          type: string
      required:
        - catalogId
        - payload
      type: object
    NotificationRule.TestSendAudienceResult:
      additionalProperties: false
      description: Outcome of resolving and attempting delivery to one NOTIFY audience.
      properties:
        audience:
          $ref: '#/components/schemas/Events.NotificationRuleAudience'
        destinationIds:
          description: >-
            Notification destination ids this audience resolved to. Empty for a
            `computed` audience (not resolved by test-send) or when resolution
            failed.
          items:
            type: string
          type: array
        dispatched:
          description: Whether a delivery attempt was made and it succeeded.
          type: boolean
        reason:
          description: >-
            Why delivery was, or was not, attempted — an unsupported destination
            kind, a disabled or missing destination, or a delivery error.
          type: string
      required:
        - audience
        - destinationIds
        - dispatched
      type: object
    NotificationRule.TestSendConditionResult:
      additionalProperties: false
      description: Outcome of evaluating one IF condition against the test-send event.
      properties:
        condition:
          $ref: '#/components/schemas/Events.NotificationRuleCondition'
        matched:
          type: boolean
        reason:
          description: >-
            Why the condition did or didn't match, e.g. a payload field it
            couldn't find.
          type: string
      required:
        - condition
        - matched
      type: object
    Errors.Action:
      additionalProperties: false
      description: Action to help user resolve the error
      properties:
        label:
          description: Button/link label text
          type: string
        url:
          description: URL to navigate to for resolution
          type: string
      required:
        - label
        - url
      type: object
    Errors.UserFacingErrorDetailSection:
      additionalProperties: false
      description: Structured user-facing error detail section.
      properties:
        items:
          description: List of detail values for this section.
          items:
            type: string
          type: array
        object:
          additionalProperties: {}
          description: Structured detail payload for object rendering.
          type: object
        render:
          description: Rendering hint for clients. Valid values are list or object.
          type: string
        title:
          description: Detail section title shown in the UI.
          type: string
      required:
        - title
        - render
      type: object
    Events.NotificationRuleAudience:
      description: >-
        One recipient of a NotificationRule's `NOTIFY`, discriminated by `kind`.

        A rule's audience list may mix fixed destinations and computed
        audiences.
      discriminator:
        mapping:
          computed: '#/components/schemas/Events.ComputedAudience'
          destination: '#/components/schemas/Events.DestinationAudience'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/Events.DestinationAudience'
        - $ref: '#/components/schemas/Events.ComputedAudience'
      type: object
    Events.NotificationRuleCondition:
      description: >-
        One clause of a NotificationRule's `IF`, discriminated by `kind`. A
        rule's

        conditions list is AND-ed together; within a single condition, the
        values

        it names (a scope condition's `in`, a time condition's `weekdays`) are

        OR-ed.
      discriminator:
        mapping:
          actor: '#/components/schemas/Events.ActorCondition'
          edge: '#/components/schemas/Events.EdgeCondition'
          payload: '#/components/schemas/Events.PayloadCondition'
          scope: '#/components/schemas/Events.ScopeCondition'
          time: '#/components/schemas/Events.TimeCondition'
        propertyName: kind
      oneOf:
        - $ref: '#/components/schemas/Events.ScopeCondition'
        - $ref: '#/components/schemas/Events.PayloadCondition'
        - $ref: '#/components/schemas/Events.EdgeCondition'
        - $ref: '#/components/schemas/Events.TimeCondition'
        - $ref: '#/components/schemas/Events.ActorCondition'
      type: object
    Events.ComputedAudience:
      additionalProperties: false
      description: |-
        Sends to a set of recipients resolved from the triggering event's own
        context rather than a fixed destination.
      properties:
        computed_kind:
          $ref: '#/components/schemas/Events.ComputedAudienceType'
        kind:
          enum:
            - computed
          type: string
      required:
        - kind
        - computed_kind
      type: object
    Events.DestinationAudience:
      additionalProperties: false
      description: Sends to a specific, pre-configured NotificationDestination.
      properties:
        destination_id:
          type: string
        kind:
          enum:
            - destination
          type: string
      required:
        - kind
        - destination_id
      type: object
    Events.ActorCondition:
      additionalProperties: false
      description: |-
        Matches when the Activity entry's actor is one of `identities`. Each is
        written `<kind>:<id>`, for example "member:mem_…", "api_key:apikey_…",
        "mcp_client:mem_…" or "service_account:svcact_…", or the bare "system"
        for Ravion itself. A member's key does not match that member's MCP
        client; name both to include both. Events that are not Activity entries
        carry no actor and never match.
      properties:
        identities:
          description: Identities to match against, OR-ed together.
          items:
            type: string
          maxItems: 50
          minItems: 1
          type: array
        kind:
          enum:
            - actor
          type: string
      required:
        - kind
        - identities
      type: object
    Events.EdgeCondition:
      additionalProperties: false
      description: |-
        Matches a transition in a subject's run history rather than a single
        event in isolation — the "only tell me the first time this fails" or
        "only tell me after 3 in a row" shape a plain event filter can't express
        on its own.
      properties:
        edge_kind:
          $ref: '#/components/schemas/Events.EdgeKind'
        kind:
          enum:
            - edge
          type: string
        'n':
          description: >-
            Consecutive-occurrence threshold. Meaningful only when `edge_kind`
            is

            CONSECUTIVE.
          format: int32
          type: integer
      required:
        - kind
        - edge_kind
      type: object
    Events.PayloadCondition:
      additionalProperties: false
      description: >-
        Matches on a field within the triggering event's enriched payload — for

        example a pipeline run's failed step count, or an alarm's threshold.

        `field` is intentionally a free string rather than a closed enum: the
        set

        of matchable fields is exactly what each event's enriched payload

        (see payloads.tsp) carries, which differs per catalog id.
      properties:
        field:
          description: Dot-path into the event's enriched payload, e.g. "failedStepCount".
          type: string
        kind:
          enum:
            - payload
          type: string
        op:
          $ref: '#/components/schemas/Events.PayloadConditionOperator'
        value:
          description: |-
            Comparison value, carried as a string regardless of the payload
            field's own type — `OVER`/`UNDER` parse it numerically at evaluation
            time.
          type: string
      required:
        - kind
        - field
        - op
        - value
      type: object
    Events.ScopeCondition:
      additionalProperties: false
      description: |-
        Matches when the triggering event's entity of `field` kind is one of
        `in` — an org's "only notify me about these projects" filter. Multiple
        ids in `in` are OR-ed together.
      properties:
        field:
          $ref: '#/components/schemas/Events.ScopeConditionField'
        in:
          description: Entity ids to match against, OR-ed together.
          items:
            type: string
          type: array
        kind:
          enum:
            - scope
          type: string
      required:
        - kind
        - field
        - in
      type: object
    Events.TimeCondition:
      additionalProperties: false
      description: |-
        Matches while the current time, in `timezone`, falls within the
        `from`–`to` window on one of `weekdays` — the "only page me during
        business hours" shape.
      properties:
        from:
          description: Window start, as "HH:MM" in `timezone`.
          type: string
        kind:
          enum:
            - time
          type: string
        timezone:
          description: >-
            IANA timezone name the window is evaluated in, e.g.
            "America/New_York".
          type: string
        to:
          description: Window end, as "HH:MM" in `timezone`.
          type: string
        weekdays:
          description: Days the window applies on. Omitted means every day.
          items:
            $ref: '#/components/schemas/Events.Weekday'
          type: array
      required:
        - kind
        - from
        - to
        - timezone
      type: object
    Events.ComputedAudienceType:
      description: |-
        A computed audience resolved at dispatch time from the triggering
        event's own context, rather than a fixed destination configured ahead of
        time.
      enum:
        - RUN_STARTER
        - APPROVERS
      type: string
    Events.EdgeKind:
      description: Which run-history transition an edge condition matches.
      enum:
        - FIRST_FAILURE
        - RECOVERY
        - CONSECUTIVE
      type: string
    Events.PayloadConditionOperator:
      description: |-
        Comparison operator a payload condition evaluates `field` with. `OVER`
        and `UNDER` compare `value` numerically; `IS` and `IS_NOT` compare it as
        an exact string match.
      enum:
        - IS
        - IS_NOT
        - OVER
        - UNDER
      type: string
    Events.ScopeConditionField:
      description: The entity kind a scope condition filters on.
      enum:
        - PROJECT
        - ENVIRONMENT
        - MODULE
        - PIPELINE
      type: string
    Events.Weekday:
      enum:
        - MONDAY
        - TUESDAY
        - WEDNESDAY
        - THURSDAY
        - FRIDAY
        - SATURDAY
        - SUNDAY
      type: string
  securitySchemes:
    BearerAuth:
      scheme: Bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.