> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/api-reference/datamart-management/scenario-automations.md).

# Scenario Automations

Operations related to **Scenario Automations**, the automated marketing workflows that guide users through multi-step journeys based on behaviors and triggers. Scenarios are composed of nodes linked by edges, with lifecycle states:

* **Triggers** - Event-based ($transaction\_confirmed, $basket\_view), segment entry, or manual testing
* **Node types** - Wait (time delays), Send email, Custom action, Add to segment, If conditions, Exit conditions
* **Lifecycle states** - Draft (being built), Paused (saved but inactive), Active (live and processing users)
* **Use cases** - Cart abandonment, post-visit campaigns, rewarding frequent readers, onboarding flows
* **Usage limits** - Default 100 paused/active scenarios, 20 active scenarios per organization

Users progress through nodes along edges until scenario completion or exit condition.

Relevant documentation:

* [Automations](https://developer.mediarithmics.io/advanced-usages/automations)
* [Automation lifecycle](https://userguides.mediarithmics.io/activation/automations/lifecycle-of-an-automation)

## GET /scenarios/{scenario\_id}/exit\_conditions/{scenario\_exit\_condition\_id}

> Get a scenario exit condition by id

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Scenario Automations","description":"Operations related to **Scenario Automations**, the automated marketing workflows that guide users through multi-step journeys based on behaviors and triggers. Scenarios are composed of nodes linked by edges, with lifecycle states:\n- **Triggers** - Event-based ($transaction_confirmed, $basket_view), segment entry, or manual testing\n- **Node types** - Wait (time delays), Send email, Custom action, Add to segment, If conditions, Exit conditions\n- **Lifecycle states** - Draft (being built), Paused (saved but inactive), Active (live and processing users)\n- **Use cases** - Cart abandonment, post-visit campaigns, rewarding frequent readers, onboarding flows\n- **Usage limits** - Default 100 paused/active scenarios, 20 active scenarios per organization\n\nUsers progress through nodes along edges until scenario completion or exit condition.\n\nRelevant documentation:\n- [Automations](https://developer.mediarithmics.io/advanced-usages/automations)\n- [Automation lifecycle](https://userguides.mediarithmics.io/activation/automations/lifecycle-of-an-automation)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/scenarios/{scenario_id}/exit_conditions/{scenario_exit_condition_id}":{"get":{"tags":["Scenario Automations"],"summary":"Get a scenario exit condition by id","operationId":"getScenarioExitCondition","description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ScenarioExitConditionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"style":"simple","in":"path","description":"ID of the scenario","schema":{"type":"string"},"name":"scenario_id","required":true,"explode":false},{"description":"ID of the scenario exit condition","schema":{"type":"string"},"name":"scenario_exit_condition_id","in":"path","explode":false,"required":true,"style":"simple"}]}}},"components":{"schemas":{"ScenarioExitConditionResource":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ScenarioExitConditionType"},"scenario_id":{"type":"string","readOnly":false},"created_by":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false}},"required":["created_by","creation_ts","id","query_id","scenario_id","type"]},"ScenarioExitConditionType":{"type":"string","enum":["EVENT"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## DELETE /scenarios/{scenario\_id}/exit\_conditions/{scenario\_exit\_condition\_id}

> Delete a scenario exit condition

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Scenario Automations","description":"Operations related to **Scenario Automations**, the automated marketing workflows that guide users through multi-step journeys based on behaviors and triggers. Scenarios are composed of nodes linked by edges, with lifecycle states:\n- **Triggers** - Event-based ($transaction_confirmed, $basket_view), segment entry, or manual testing\n- **Node types** - Wait (time delays), Send email, Custom action, Add to segment, If conditions, Exit conditions\n- **Lifecycle states** - Draft (being built), Paused (saved but inactive), Active (live and processing users)\n- **Use cases** - Cart abandonment, post-visit campaigns, rewarding frequent readers, onboarding flows\n- **Usage limits** - Default 100 paused/active scenarios, 20 active scenarios per organization\n\nUsers progress through nodes along edges until scenario completion or exit condition.\n\nRelevant documentation:\n- [Automations](https://developer.mediarithmics.io/advanced-usages/automations)\n- [Automation lifecycle](https://userguides.mediarithmics.io/activation/automations/lifecycle-of-an-automation)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/scenarios/{scenario_id}/exit_conditions/{scenario_exit_condition_id}":{"delete":{"description":"","summary":"Delete a scenario exit condition","parameters":[{"description":"ID of the scenario","explode":false,"required":true,"in":"path","name":"scenario_id","schema":{"type":"string"},"style":"simple"},{"explode":false,"required":true,"in":"path","style":"simple","description":"ID of the scenario exit condition","name":"scenario_exit_condition_id","schema":{"type":"string"}}],"tags":["Scenario Automations"],"operationId":"deleteScenarioExitCondition","responses":{"200":{"$ref":"#/components/responses/simple"},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"responses":{"simple":{"description":"Success response","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]}}}},"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}},"schemas":{"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}}}}
```

## GET /scenarios/{scenario\_id}/exit\_conditions

> Get the scenario exit conditions

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Scenario Automations","description":"Operations related to **Scenario Automations**, the automated marketing workflows that guide users through multi-step journeys based on behaviors and triggers. Scenarios are composed of nodes linked by edges, with lifecycle states:\n- **Triggers** - Event-based ($transaction_confirmed, $basket_view), segment entry, or manual testing\n- **Node types** - Wait (time delays), Send email, Custom action, Add to segment, If conditions, Exit conditions\n- **Lifecycle states** - Draft (being built), Paused (saved but inactive), Active (live and processing users)\n- **Use cases** - Cart abandonment, post-visit campaigns, rewarding frequent readers, onboarding flows\n- **Usage limits** - Default 100 paused/active scenarios, 20 active scenarios per organization\n\nUsers progress through nodes along edges until scenario completion or exit condition.\n\nRelevant documentation:\n- [Automations](https://developer.mediarithmics.io/advanced-usages/automations)\n- [Automation lifecycle](https://userguides.mediarithmics.io/activation/automations/lifecycle-of-an-automation)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/scenarios/{scenario_id}/exit_conditions":{"get":{"description":"","summary":"Get the scenario exit conditions","tags":["Scenario Automations"],"operationId":"getScenarioExitConditions","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"max_results":{"type":"integer"},"count":{"type":"integer"},"first_result":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/ScenarioExitConditionResource"}},"status":{"type":"string","enum":["ok"]}},"required":["count","data","first_result","max_results","status","total"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}},"parameters":[{"in":"path","style":"simple","required":true,"description":"ID of the scenario","name":"scenario_id","explode":false,"schema":{"type":"string"}},{"required":false,"explode":true,"schema":{"type":"integer","format":"int32"},"style":"form","name":"first_result","description":"Offset from which the search must be performed","in":"query"},{"in":"query","description":"Number of maximum items that shall be return by this search","style":"form","required":false,"schema":{"type":"integer","format":"int32"},"explode":true,"name":"max_results"}]}}},"components":{"schemas":{"ScenarioExitConditionResource":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ScenarioExitConditionType"},"scenario_id":{"type":"string","readOnly":false},"created_by":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false}},"required":["created_by","creation_ts","id","query_id","scenario_id","type"]},"ScenarioExitConditionType":{"type":"string","enum":["EVENT"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```

## POST /scenarios/{scenario\_id}/exit\_conditions

> Create a exit condition to the scenario

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Scenario Automations","description":"Operations related to **Scenario Automations**, the automated marketing workflows that guide users through multi-step journeys based on behaviors and triggers. Scenarios are composed of nodes linked by edges, with lifecycle states:\n- **Triggers** - Event-based ($transaction_confirmed, $basket_view), segment entry, or manual testing\n- **Node types** - Wait (time delays), Send email, Custom action, Add to segment, If conditions, Exit conditions\n- **Lifecycle states** - Draft (being built), Paused (saved but inactive), Active (live and processing users)\n- **Use cases** - Cart abandonment, post-visit campaigns, rewarding frequent readers, onboarding flows\n- **Usage limits** - Default 100 paused/active scenarios, 20 active scenarios per organization\n\nUsers progress through nodes along edges until scenario completion or exit condition.\n\nRelevant documentation:\n- [Automations](https://developer.mediarithmics.io/advanced-usages/automations)\n- [Automation lifecycle](https://userguides.mediarithmics.io/activation/automations/lifecycle-of-an-automation)\n"}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/scenarios/{scenario_id}/exit_conditions":{"post":{"requestBody":{"description":"the scenario exit condition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScenarioExitConditionResource"}}},"required":true},"summary":"Create a exit condition to the scenario","operationId":"createScenarioExitCondition","tags":["Scenario Automations"],"parameters":[{"description":"ID of the scenario","style":"simple","name":"scenario_id","in":"path","required":true,"explode":false,"schema":{"type":"string"}}],"description":"","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/ScenarioExitConditionResource"}},"required":["data","status"]}}}},"400":{"$ref":"#/components/responses/error"},"401":{"$ref":"#/components/responses/error"},"403":{"$ref":"#/components/responses/error"},"404":{"$ref":"#/components/responses/error"},"500":{"$ref":"#/components/responses/error"},"503":{"$ref":"#/components/responses/error"}}}}},"components":{"schemas":{"ScenarioExitConditionResource":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ScenarioExitConditionType"},"scenario_id":{"type":"string","readOnly":false},"created_by":{"type":"string","readOnly":true},"id":{"type":"string","readOnly":true},"creation_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"query_id":{"type":"string","readOnly":false}},"required":["created_by","creation_ts","id","query_id","scenario_id","type"]},"ScenarioExitConditionType":{"type":"string","enum":["EVENT"],"readOnly":false},"errorResponse":{"type":"object","properties":{"status":{"type":"string","enum":["error"]},"error_code":{"type":"string","enum":["AUTHENTICATION_ERROR","AUTHORIZATION_ERROR","BAD_REQUEST_DATA","BAD_REQUEST_FORMAT","CONSTRAINT_VIOLATION_EXCEPTION","EMAIL_ALREADY_EXISTS","MAC_ERROR","RESOURCE_NOT_FOUND","SERVICE_UNAVAILABLE","TOKEN_ERROR"]},"error_id":{"type":"string"},"error":{"type":"string"}},"required":["error","error_code","error_id","status"]}},"responses":{"error":{"description":"Error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/errorResponse"}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/api-reference/datamart-management/scenario-automations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
