Stop
Stop is a pipeline for processing the completion of a placement mailing. If configured, the mailing can be stopped manually or on schedule.
From a technical perspective, completion is a separate launch of a mailing, where messages are sent not to the Message pipeline, but to Stop. In this pipeline, you can implement the logic for stopping the placement on the external service side — for example, send a request to remove a banner or cancel a campaign.
To implement the stop action, use the Eventer pipe with the event type stop.
Minimal example
A pipeline that sends a request to stop the placement and registers a stop event:
[
{
"id": 1,
"type": "http_request",
"params": {
"method": "POST",
"timeout": 10,
"content_type": "json",
"url": "https://api.example.com/campaign/stop",
"success_codes": [200]
},
"outs": {
"success": 2,
"error": 3
}
},
{
"id": 2,
"type": "event",
"params": {
"event_type": "stop",
"event": {
"send_message_id": "$origin.send_message_id"
}
}
},
{
"id": 3,
"type": "log",
"params": {
"message": "Stop failed: $error.code $error.message",
"level": "error"
}
}
]