> 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/monitoring-and-metadata/alerts.md).

# Alerts

Operations related to Alerts for monitoring platform events and triggering notifications based on predefined conditions. Enables automated alerting for critical events such as segment drops, with configurable alert types and delivery preferences.

## GET /alerts

> Find alerts

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Operations related to Alerts for monitoring platform events and triggering notifications based on predefined conditions. Enables automated alerting for critical events such as segment drops, with configurable alert types and delivery preferences."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/alerts":{"get":{"description":"","parameters":[{"explode":true,"required":false,"description":"Organisation owning the alerts","in":"query","style":"form","name":"organisation_id","schema":{"type":"integer","format":"int64"}},{"explode":true,"required":false,"schema":{"type":"string"},"in":"query","style":"form","name":"community_id","description":"Community owning the alerts"},{"name":"datamart_id","in":"query","style":"form","description":"Datamart owning the alerts","explode":true,"required":false,"schema":{"type":"string"}},{"style":"form","schema":{"$ref":"#/components/schemas/AlertType"},"explode":true,"name":"alert_type","description":"The type of the alerts","required":false,"in":"query"},{"in":"query","style":"form","explode":true,"name":"alert_subtype","required":false,"description":"The subtype of the alerts","schema":{"$ref":"#/components/schemas/AlertSubtype"}},{"description":"Segment link to the alert","style":"form","schema":{"type":"string"},"name":"segment_id","explode":true,"required":false,"in":"query"},{"name":"archived","style":"form","in":"query","description":"If true the result will contain only archived alerts","explode":true,"required":false,"schema":{"type":"boolean"}},{"style":"form","schema":{"type":"integer","format":"int32"},"name":"first_result","required":false,"description":"Offset from which the search must be performed","explode":true,"in":"query"},{"description":"Number of maximum items that shall be return by this search","required":false,"in":"query","schema":{"type":"integer","format":"int32"},"explode":true,"name":"max_results","style":"form"},{"explode":true,"name":"from","required":false,"style":"form","schema":{"type":"string"},"description":"We return alerts from this date","in":"query"},{"schema":{"type":"string"},"in":"query","style":"form","name":"to","description":"We return alerts to this date","explode":true,"required":false},{"required":false,"explode":true,"style":"form","name":"fetch_all","description":"Either we should return archived AND unarchived alerts or not","in":"query","schema":{"type":"boolean"}},{"explode":true,"name":"group_by","required":false,"in":"query","schema":{"type":"boolean"},"description":"Either we should return only last non-archived alert for each segment","style":"form"}],"summary":"Find alerts","responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"max_results":{"type":"integer"},"count":{"type":"integer"},"data":{"type":"array","items":{"$ref":"#/components/schemas/AlertResource"}},"first_result":{"type":"integer"},"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"}},"tags":["Alerts"],"operationId":"findAlerts"}}},"components":{"schemas":{"AlertType":{"type":"string","enum":["SEGMENT_VOLUME_DROP","SEGMENT_COMPUTATION_ERROR","SEGMENT_DEFINITION_ERROR","SEGMENT_INITIAL_LOADING"],"readOnly":false},"AlertSubtype":{"type":"string","enum":["INITIAL_LOADING_NOT_STARTING","INITIAL_LOADING_RUNNING_TOO_LONG","INITIAL_LOADING_EXECUTION_ON_ERROR","INITIAL_LOADING_RECORDS_ERROR"],"readOnly":false},"AlertResource":{"discriminator":{"propertyName":"type","mapping":{"SEGMENT_VOLUME_DROP":"#/components/schemas/SegmentVolumeDropAlertResource","SEGMENT_DEFINITION_ERROR":"#/components/schemas/SegmentDefinitionErrorAlertResource","SEGMENT_COMPUTATION_ERROR":"#/components/schemas/SegmentComputationErrorAlertResource","SEGMENT_INITIAL_LOADING":"#/components/schemas/SegmentInitialLoadingAlertResource"}},"oneOf":[{"$ref":"#/components/schemas/SegmentVolumeDropAlertResource"},{"$ref":"#/components/schemas/SegmentDefinitionErrorAlertResource"},{"$ref":"#/components/schemas/SegmentComputationErrorAlertResource"},{"$ref":"#/components/schemas/SegmentInitialLoadingAlertResource"}],"properties":{"type":{"type":"string","enum":["SEGMENT_VOLUME_DROP","SEGMENT_DEFINITION_ERROR","SEGMENT_COMPUTATION_ERROR","SEGMENT_INITIAL_LOADING"]}},"required":["type"]},"SegmentVolumeDropAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"drop_rate_from_initial":{"readOnly":false,"type":"number","format":"float","default":0},"user_point_count":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived_by":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":true},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"user_point_count_from_initial":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"drop_rate":{"type":"number","format":"float","default":0,"readOnly":false},"datamart_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","drop_rate","expiration","id","last_count_ts","organisation_id","segment"]}]},"SegmentAlert":{"type":"object"},"SegmentInfo":{"type":"object","properties":{"segment_type":{"$ref":"#/components/schemas/AudienceSegmentType"},"segment_id":{"type":"string","readOnly":false},"segment_name":{"type":"string","readOnly":false},"feeds_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":false}},"required":["feeds_count","segment_id","segment_name"]},"AudienceSegmentType":{"type":"string","enum":["USER_LIST","USER_QUERY","USER_LOOKALIKE_BY_COHORTS","USER_LOOKALIKE","USER_ACTIVATION","USER_PARTITION","USER_DATA_SUBSCRIPTION","CLEAN_ROOM"],"readOnly":false},"SegmentDefinitionErrorAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":true},"archived_by":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","expiration","id","last_count_ts","organisation_id","segment"]}]},"SegmentComputationErrorAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"message":{"type":"string","readOnly":false},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":true},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived_by":{"type":"string","readOnly":false},"community_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","expiration","id","last_count_ts","organisation_id","segment"]}]},"SegmentInitialLoadingAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"archived_by":{"type":"string","readOnly":false},"message":{"type":"string","readOnly":false},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"community_id":{"type":"string","readOnly":true},"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"feed_id":{"type":"string","readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"alert_subtype":{"$ref":"#/components/schemas/AlertSubtype"},"organisation_id":{"type":"string","readOnly":true},"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"datamart_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","expiration","feed_id","id","last_count_ts","organisation_id","segment"]}]},"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"}}}}}}}
```

## PUT /alerts/{alert\_id}

> Archive/unarchive an alert

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Operations related to Alerts for monitoring platform events and triggering notifications based on predefined conditions. Enables automated alerting for critical events such as segment drops, with configurable alert types and delivery preferences."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/alerts/{alert_id}":{"put":{"operationId":"archiveAlert","tags":["Alerts"],"summary":"Archive/unarchive an alert","description":"","parameters":[{"explode":false,"in":"path","required":true,"name":"alert_id","style":"simple","schema":{"type":"string"},"description":"The alert id"},{"style":"form","schema":{"type":"boolean"},"name":"archive","required":true,"in":"query","explode":true}],"responses":{"200":{"description":"Success !","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]},"data":{"$ref":"#/components/schemas/AlertResource"}},"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":{"AlertResource":{"discriminator":{"propertyName":"type","mapping":{"SEGMENT_VOLUME_DROP":"#/components/schemas/SegmentVolumeDropAlertResource","SEGMENT_DEFINITION_ERROR":"#/components/schemas/SegmentDefinitionErrorAlertResource","SEGMENT_COMPUTATION_ERROR":"#/components/schemas/SegmentComputationErrorAlertResource","SEGMENT_INITIAL_LOADING":"#/components/schemas/SegmentInitialLoadingAlertResource"}},"oneOf":[{"$ref":"#/components/schemas/SegmentVolumeDropAlertResource"},{"$ref":"#/components/schemas/SegmentDefinitionErrorAlertResource"},{"$ref":"#/components/schemas/SegmentComputationErrorAlertResource"},{"$ref":"#/components/schemas/SegmentInitialLoadingAlertResource"}],"properties":{"type":{"type":"string","enum":["SEGMENT_VOLUME_DROP","SEGMENT_DEFINITION_ERROR","SEGMENT_COMPUTATION_ERROR","SEGMENT_INITIAL_LOADING"]}},"required":["type"]},"SegmentVolumeDropAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"drop_rate_from_initial":{"readOnly":false,"type":"number","format":"float","default":0},"user_point_count":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived_by":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":true},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"user_point_count_from_initial":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"drop_rate":{"type":"number","format":"float","default":0,"readOnly":false},"datamart_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","drop_rate","expiration","id","last_count_ts","organisation_id","segment"]}]},"SegmentAlert":{"type":"object"},"SegmentInfo":{"type":"object","properties":{"segment_type":{"$ref":"#/components/schemas/AudienceSegmentType"},"segment_id":{"type":"string","readOnly":false},"segment_name":{"type":"string","readOnly":false},"feeds_count":{"type":"integer","format":"int32","default":0,"readOnly":false},"user_points_count":{"type":"integer","format":"int32","default":0,"readOnly":false}},"required":["feeds_count","segment_id","segment_name"]},"AudienceSegmentType":{"type":"string","enum":["USER_LIST","USER_QUERY","USER_LOOKALIKE_BY_COHORTS","USER_LOOKALIKE","USER_ACTIVATION","USER_PARTITION","USER_DATA_SUBSCRIPTION","CLEAN_ROOM"],"readOnly":false},"SegmentDefinitionErrorAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"community_id":{"type":"string","readOnly":true},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"id":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"datamart_id":{"type":"string","readOnly":true},"archived_by":{"type":"string","readOnly":false},"organisation_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","expiration","id","last_count_ts","organisation_id","segment"]}]},"SegmentComputationErrorAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived":{"type":"boolean","default":false,"readOnly":false},"message":{"type":"string","readOnly":false},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"datamart_id":{"type":"string","readOnly":true},"organisation_id":{"type":"string","readOnly":true},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"archived_by":{"type":"string","readOnly":false},"community_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","expiration","id","last_count_ts","organisation_id","segment"]}]},"SegmentInitialLoadingAlertResource":{"allOf":[{"$ref":"#/components/schemas/SegmentAlert"},{"type":"object","properties":{"archived_by":{"type":"string","readOnly":false},"message":{"type":"string","readOnly":false},"archived_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"id":{"type":"string","readOnly":true},"count":{"type":"integer","format":"int64","default":0,"readOnly":false},"archived":{"type":"boolean","default":false,"readOnly":false},"community_id":{"type":"string","readOnly":true},"expiration":{"type":"integer","format":"int64","default":0,"readOnly":true},"feed_id":{"type":"string","readOnly":false},"created_ts":{"type":"integer","format":"int64","default":0,"readOnly":true},"alert_subtype":{"$ref":"#/components/schemas/AlertSubtype"},"organisation_id":{"type":"string","readOnly":true},"last_count_ts":{"type":"integer","format":"int64","default":0,"readOnly":false},"segment":{"$ref":"#/components/schemas/SegmentInfo"},"datamart_id":{"type":"string","readOnly":true}},"required":["archived","community_id","count","created_ts","datamart_id","expiration","feed_id","id","last_count_ts","organisation_id","segment"]}]},"AlertSubtype":{"type":"string","enum":["INITIAL_LOADING_NOT_STARTING","INITIAL_LOADING_RUNNING_TOO_LONG","INITIAL_LOADING_EXECUTION_ON_ERROR","INITIAL_LOADING_RECORDS_ERROR"],"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 /alerts/{alert\_id}

> Delete an alert

```json
{"openapi":"3.1.1","info":{"title":"mediarithmics openapi API","version":"1.0.0"},"tags":[{"name":"Alerts","description":"Operations related to Alerts for monitoring platform events and triggering notifications based on predefined conditions. Enables automated alerting for critical events such as segment drops, with configurable alert types and delivery preferences."}],"servers":[{"url":"http://api.mediarithmics.local/v1","description":"Development server"},{"url":"https://api.mediarithmics.com/v1","description":"Production server"}],"paths":{"/alerts/{alert_id}":{"delete":{"summary":"Delete an alert","tags":["Alerts"],"parameters":[{"style":"simple","in":"path","name":"alert_id","schema":{"type":"string"},"description":"The alert id","required":true,"explode":false}],"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"}},"description":"","operationId":"deleteAlert"}}},"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"]}}}}
```


---

# 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/monitoring-and-metadata/alerts.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.
