---
title: "Evaluate Calculation"
method: POST
path: "/organizations/{orgId}/notifications/evaluate"
tags: ["Notifications"]
---

# Evaluate Calculation

`POST /organizations/{orgId}/notifications/evaluate`

Evaluates a calculation against a specific Event or an Event type without triggering a Notification. This is useful for validating your calculation logic before adding it to a Notification.

You can use either the `eventId` or `eventName` to test your calculation against:
- `eventId` Tests the calculation for validity against a *specific Event* that has been generated for your Organization.
- `eventName` Tests the calculation for validity against the *Event type*.

Possible outcomes:
- If in either case the calculation is valid, then `"success" : true` is returned.
- If in either case the calculation is invalid, then `"success" : false` is returned, together with an `"error message"` giving the reason why the calculation is invaild for use against the specific Event or Event type.

**Note:** If you use both the `eventId` and the `eventName` as request body parameters in a single call, then the `eventName` takes precedence and the calculation is evaluated for validity against the *Event type*.

## Path parameters

- `orgId` string, required

## Request body

- EvaluateCalculationRequest — Request for evaluating a calculation against an existing Event or Event name.
  - `eventId` string — The unique identifier (UUID) of the existing Event you want to evaluate the calculation for.
  - `eventName` string — The name of the Event type to evaluate the calculation for.
  - `calculation` string — The calculation expression to be evaluated. This should be structured in the same way as the calculation you'll use for a Notification based on an Event of the same type. The calculation for a Notification is a logical expression that evaluates to a Boolean. Calculations are used to define the precise conditions for a Notification that is based on an Event of a specifc Type to be triggered. If an Event of that type occurs and the calculation used in a Notification based on that Event type evaluates as `True`, a Notification for the Event is triggered and sent to the configured Notification destination. Calculations can reference numeric, string, and boolean Event fields. See [Creating Calculations](https://www.m3ter.com/docs/guides/utilizing-events-and-notifications/key-concepts-and-relationships#creating-calculations) in the m3ter documentation for more information.

## Response `200`

Returns the calculation result

- EvaluateCalculationResponse — Response containing the results of a calculation evaluation.
  - `success` boolean, required — Indicates whether the calculation evaluated to True against the specified Event.
  - `errorMessage` string — Optional message providing details about any errors that occurred during the evaluation. If no errors occurred, this is `null`.

## Other responses

- `4XX` — Error message
- `5XX` — Error message

---

[API](https://skmtc.net/m3ter-com/apis/m3ter-api.md) · [All operations](https://skmtc.net/m3ter-com/apis/m3ter-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/m3ter-com/m3ter-api/versions/ac93d1a9e6d9/schema)
