{
    "openapi": "3.0.3",
    "info": {
        "title": "A360 API",
        "description": "SendPulse Automation 360 public API",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.sendpulse.com/a360",
            "description": "Production"
        }
    ],
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "bearerFormat": "JWT",
                "description": "Paste a Bearer token obtained from the SendPulse token endpoint.\n\n**Get your API keys:** https://login.sendpulse.com/settings/api (Credentials tab)\n\n**Obtain a token:**\n```\nPOST https://api.sendpulse.com/oauth/access_token\nContent-Type: application/x-www-form-urlencoded\n\ngrant_type=client_credentials&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET\n```\nThe `access_token` field in the response is your Bearer token. Tokens expire after 1 hour."
            }
        },
        "schemas": {
            "ErrorBody": {
                "type": "object",
                "properties": {
                    "type": {
                        "type": "string",
                        "example": "not_found"
                    },
                    "messages": {
                        "oneOf": [
                            {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                }
                            }
                        ]
                    }
                }
            },
            "LaravelValidationErrorBody": {
                "type": "object",
                "description": "Laravel validation error — returned when a parameter value fails enum or rule validation",
                "properties": {
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "example": {
                            "flow_type": [
                                "The selected flow type is invalid."
                            ]
                        }
                    }
                }
            },
            "UnauthorizedBody": {
                "type": "object",
                "description": "Returned when the Bearer token is missing or the JWT is invalid/expired",
                "properties": {
                    "message": {
                        "type": "string",
                        "example": "Unauthorized!"
                    },
                    "error_code": {
                        "type": "integer",
                        "example": 401
                    }
                }
            },
            "GatewayErrorBody": {
                "type": "object",
                "description": "Returned by the OAuth gateway — on bad API key (404) or rate-limit exceeded (429)",
                "properties": {
                    "message": {
                        "type": "string",
                        "example": "Rate limit exceeded"
                    },
                    "code": {
                        "type": "integer",
                        "example": 429
                    },
                    "error": {
                        "type": "string",
                        "example": "Rate limit exceeded"
                    },
                    "error_description": {
                        "type": "string",
                        "example": "Rate limit exceeded"
                    }
                }
            },
            "ExternalData": {
                "description": "CRM entity linked to the event trigger. Shape depends on entity type.",
                "oneOf": [
                    {
                        "type": "object",
                        "description": "CRM Deal",
                        "properties": {
                            "deal_id": {
                                "type": "string",
                                "example": "14773045"
                            },
                            "deal_name": {
                                "type": "string",
                                "example": "two_cont"
                            },
                            "deal_url": {
                                "type": "string",
                                "example": "https://login.sendpulse.com/crm/deals?dealId=14773045"
                            }
                        }
                    },
                    {
                        "type": "object",
                        "description": "CRM Contact",
                        "properties": {
                            "contact_id": {
                                "type": "string",
                                "example": "40530491"
                            },
                            "contact_name": {
                                "type": "string",
                                "example": "without"
                            },
                            "contact_url": {
                                "type": "string",
                                "example": "https://login.sendpulse.com/crm/contacts?contactId=40530491"
                            }
                        }
                    },
                    {
                        "type": "object",
                        "description": "CRM Task",
                        "properties": {
                            "task_id": {
                                "type": "string",
                                "example": "123"
                            },
                            "task_name": {
                                "type": "string",
                                "example": "Task name"
                            },
                            "task_url": {
                                "type": "string",
                                "example": "https://login.sendpulse.com/crm/tasks?taskId=123"
                            }
                        }
                    }
                ]
            },
            "TriggerItem": {
                "type": "object",
                "properties": {
                    "email": {
                        "type": "string",
                        "nullable": true,
                        "example": "user@example.com"
                    },
                    "email_b64": {
                        "type": "string",
                        "nullable": true,
                        "example": "dXNlckBleGFtcGxlLmNvbQ=="
                    },
                    "phone": {
                        "type": "integer",
                        "nullable": true,
                        "example": 380632727700
                    },
                    "event_id": {
                        "type": "string",
                        "example": "a1b2c3d4"
                    },
                    "flow_id": {
                        "type": "integer",
                        "example": 1906431
                    },
                    "execution_date": {
                        "type": "string",
                        "example": "2024-06-01 12:00:00"
                    },
                    "external_data": {
                        "oneOf": [
                            {
                                "$ref": "#/components/schemas/ExternalData"
                            },
                            {
                                "type": "array",
                                "maxItems": 0
                            }
                        ]
                    }
                }
            },
            "StatGroupItem": {
                "type": "object",
                "description": "Aggregated operator statistics",
                "properties": {
                    "executed": {
                        "type": "integer",
                        "example": 150
                    },
                    "deleted": {
                        "type": "integer",
                        "example": 5
                    },
                    "last_send": {
                        "type": "string",
                        "nullable": true,
                        "example": "2024-06-01 12:00:00"
                    }
                }
            },
            "PaginatedTriggerList": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/TriggerItem"
                        }
                    },
                    "is_next": {
                        "type": "boolean",
                        "example": true
                    }
                }
            },
            "SummaryStatistic": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "queue": {
                                "type": "integer",
                                "example": 10
                            },
                            "summ_sent": {
                                "type": "integer",
                                "example": 500
                            },
                            "completed": {
                                "type": "integer",
                                "example": 485
                            },
                            "deleted": {
                                "type": "integer",
                                "example": 5
                            },
                            "count_items": {
                                "type": "integer",
                                "example": 3
                            },
                            "last_send": {
                                "type": "string",
                                "nullable": true,
                                "example": "2024-06-01 12:00:00"
                            }
                        }
                    }
                }
            },
            "AutoresponderItem": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer",
                        "example": 1
                    },
                    "name": {
                        "type": "string",
                        "example": "Welcome series"
                    },
                    "status": {
                        "type": "integer",
                        "enum": [
                            0,
                            1,
                            3
                        ],
                        "example": 1,
                        "description": "0 — New, 1 — Active, 3 — Pause"
                    },
                    "created": {
                        "type": "string",
                        "example": "2024-05-15 15:16:31"
                    },
                    "changed": {
                        "type": "string",
                        "example": "2024-05-15 15:16:31"
                    }
                }
            }
        },
        "responses": {
            "NotFoundResponse": {
                "description": "Resource not found, or the API key supplied to the OAuth gateway is malformed",
                "content": {
                    "application/json": {
                        "schema": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/ErrorBody"
                                },
                                {
                                    "$ref": "#/components/schemas/GatewayErrorBody"
                                }
                            ]
                        },
                        "examples": {
                            "not_found": {
                                "summary": "Resource not found",
                                "value": {
                                    "type": "not_found",
                                    "messages": [
                                        "Not found"
                                    ]
                                }
                            },
                            "bad_key": {
                                "summary": "Malformed API key (gateway layer)",
                                "value": {
                                    "message": "Invalid API key length",
                                    "code": 404,
                                    "error": "Invalid API key length",
                                    "error_description": "Invalid API key length"
                                }
                            }
                        }
                    }
                }
            },
            "ValidationErrorResponse": {
                "description": "Validation failed — missing required parameters or invalid parameter values",
                "content": {
                    "application/json": {
                        "schema": {
                            "oneOf": [
                                {
                                    "$ref": "#/components/schemas/ErrorBody"
                                },
                                {
                                    "$ref": "#/components/schemas/LaravelValidationErrorBody"
                                }
                            ]
                        },
                        "examples": {
                            "missing_param": {
                                "summary": "Required parameter missing",
                                "value": {
                                    "type": "validation_error",
                                    "messages": {
                                        "limit": [
                                            "The limit field is required."
                                        ]
                                    }
                                }
                            },
                            "invalid_enum": {
                                "summary": "Parameter value not in allowed set",
                                "value": {
                                    "errors": {
                                        "flow_type": [
                                            "The selected flow type is invalid."
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "UnauthenticatedResponse": {
                "description": "Bearer token missing or JWT invalid/expired",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/UnauthorizedBody"
                        },
                        "example": {
                            "message": "Unauthorized!",
                            "error_code": 401
                        }
                    }
                }
            },
            "ForbiddenResponse": {
                "description": "Access denied",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorBody"
                        },
                        "example": {
                            "type": "forbidden",
                            "messages": [
                                "forbidden"
                            ]
                        }
                    }
                }
            },
            "UnprocessableEntityResponse": {
                "description": "Unprocessable entity",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/ErrorBody"
                        },
                        "example": {
                            "type": "unprocessable_entity",
                            "messages": [
                                "Wrong input data"
                            ]
                        }
                    }
                }
            },
            "RateLimitResponse": {
                "description": "Rate limit exceeded. SendPulse enforces per-minute and per-day request quotas across all API endpoints. See https://sendpulse.com/integrations/api (API Description → Request limits) for current quota values by plan. The response does not include Retry-After or X-RateLimit-* headers.",
                "content": {
                    "application/json": {
                        "schema": {
                            "$ref": "#/components/schemas/GatewayErrorBody"
                        },
                        "example": {
                            "message": "Too Many Requests",
                            "code": 429,
                            "error": "User has sent too many requests in a given amount of time.",
                            "error_description": "User has sent too many requests in a given amount of time."
                        }
                    }
                }
            },
            "ServerErrorResponse": {
                "description": "Internal server error — e.g. unsupported parameter value that passes validation but causes a query failure",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "example": "Server Error"
                                }
                            }
                        },
                        "example": {
                            "message": "Server Error"
                        }
                    }
                }
            }
        },
        "parameters": {
            "FlowIdParam": {
                "name": "elementId",
                "in": "path",
                "required": true,
                "description": "Element ID, you can get with the Get statistics about an automation flow method",
                "schema": {
                    "type": "integer"
                }
            },
            "ElementIdParam": {
                "name": "elementId",
                "in": "path",
                "required": true,
                "description": "Element ID — substitute with your own. You can get it from the Get statistics about an automation flow method.",
                "schema": {
                    "type": "integer"
                }
            },
            "IdParam": {
                "name": "id",
                "in": "path",
                "required": true,
                "description": "Element ID, you can get with the Get statistics about an automation flow method",
                "schema": {
                    "type": "integer"
                }
            },
            "CodeParam": {
                "name": "code",
                "in": "path",
                "required": true,
                "description": "UUID short link code",
                "schema": {
                    "type": "string",
                    "format": "uuid",
                    "example": "550e8400-e29b-41d4-a716-446655440000"
                }
            },
            "LimitParam": {
                "name": "limit",
                "in": "query",
                "required": false,
                "description": "Number of items per page",
                "schema": {
                    "type": "integer",
                    "minimum": 1
                }
            },
            "OffsetParam": {
                "name": "offset",
                "in": "query",
                "required": false,
                "description": "Number of items to skip",
                "schema": {
                    "type": "integer",
                    "minimum": 0
                }
            },
            "LimitParamRequired": {
                "name": "limit",
                "in": "query",
                "required": true,
                "description": "Number of items per page",
                "schema": {
                    "type": "integer",
                    "minimum": 1
                }
            },
            "OffsetParamRequired": {
                "name": "offset",
                "in": "query",
                "required": true,
                "description": "Number of items to skip",
                "schema": {
                    "type": "integer",
                    "minimum": 0
                }
            },
            "LimitParamConversions": {
                "name": "limit",
                "in": "query",
                "required": false,
                "description": "Number of items per page (maximum 100)",
                "schema": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                }
            },
            "SortDirectionParam": {
                "name": "sortDirection",
                "in": "query",
                "required": false,
                "description": "Sort direction. Takes effect only together with sortField. When sortField is set and this parameter is omitted, asc is used.",
                "schema": {
                    "type": "string",
                    "enum": [
                        "asc",
                        "desc"
                    ]
                }
            },
            "SortFieldParam": {
                "name": "sortField",
                "in": "query",
                "required": false,
                "description": "Field to sort by. If omitted, no sorting is applied and rows are returned in storage order.",
                "schema": {
                    "type": "string"
                }
            },
            "FilterJsonParamOptional": {
                "name": "filter",
                "in": "query",
                "required": false,
                "description": "URL-encoded JSON segmentation filter. Must follow the group/expression/fields structure. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`",
                "schema": {
                    "type": "string",
                    "example": "{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}"
                }
            },
            "FilterJsonParam": {
                "name": "filter",
                "in": "query",
                "required": true,
                "description": "URL-encoded JSON segmentation filter. Must follow the group/expression/fields structure. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`",
                "schema": {
                    "type": "string",
                    "example": "{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}"
                }
            }
        }
    },
    "paths": {
        "/stats/main-trigger/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Main Trigger"
                ],
                "summary": "Get main trigger group stats",
                "description": "Returns aggregated statistics for the main trigger operator: total executed, deleted, and in-queue (expects) count.",
                "operationId": "stats.mainTrigger.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Group stats",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 500
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 15,
                                                    "description": "Subscribers currently in queue"
                                                },
                                                "deleted": {
                                                    "type": "integer",
                                                    "example": 5
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 10,
                                        "executed": 500,
                                        "expects": 15,
                                        "deleted": 5
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/main-trigger/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Main Trigger"
                ],
                "summary": "Get main trigger group stats (date filtered)",
                "description": "Returns aggregated stats filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.mainTrigger.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered group stats",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "200"
                                                },
                                                "deleted": {
                                                    "type": "string",
                                                    "example": "5"
                                                },
                                                "end_count": {
                                                    "type": "string",
                                                    "example": "195"
                                                },
                                                "stopped": {
                                                    "type": "string",
                                                    "example": "0"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 12:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "200",
                                        "deleted": "5",
                                        "end_count": "195",
                                        "stopped": "0",
                                        "last_send": "2024-06-01 12:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/main-trigger/{elementId}/addresses": {
            "get": {
                "tags": [
                    "Stats — Main Trigger"
                ],
                "summary": "Get subscriber list (paginated)",
                "description": "Returns a paginated list of subscribers who entered the automation.",
                "operationId": "stats.mainTrigger.addresses",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/SortDirectionParam"
                    },
                    {
                        "$ref": "#/components/parameters/SortFieldParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Paginated subscriber list",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/PaginatedTriggerList"
                                },
                                "example": {
                                    "data": [
                                        {
                                            "email": "user@example.com",
                                            "email_b64": "dXNlckBleGFtcGxlLmNvbQ==",
                                            "phone": 380632727700,
                                            "event_id": "a1b2c3d4",
                                            "flow_id": 1906431,
                                            "execution_date": "2024-06-01 12:00:00",
                                            "external_data": []
                                        }
                                    ],
                                    "is_next": true
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/email/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Email"
                ],
                "summary": "Get email summary stats",
                "description": "Returns aggregated email statistics for the automation. Optionally filter by specific `emails[]`, `sent_date_from`, `sent_date_to` query parameters to recalculate on the fly.",
                "operationId": "stats.email.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "name": "emails[]",
                        "in": "query",
                        "required": false,
                        "description": "Filter by specific email addresses",
                        "schema": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "format": "email"
                            }
                        }
                    },
                    {
                        "name": "sent_date_from",
                        "in": "query",
                        "required": false,
                        "description": "Filter: sent date from (Y-m-d)",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-05-01"
                        }
                    },
                    {
                        "name": "sent_date_to",
                        "in": "query",
                        "required": false,
                        "description": "Filter: sent date to (Y-m-d)",
                        "schema": {
                            "type": "string",
                            "format": "date",
                            "example": "2024-06-01"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Aggregated email summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "task": {
                                                    "type": "object",
                                                    "nullable": true,
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer",
                                                            "example": 12018943
                                                        },
                                                        "address_book_id": {
                                                            "type": "integer",
                                                            "example": 0
                                                        },
                                                        "message_title": {
                                                            "type": "string",
                                                            "example": "Thank you for your order"
                                                        },
                                                        "sender_mail_address": {
                                                            "type": "string",
                                                            "example": "sender@example.com"
                                                        },
                                                        "sender_mail_name": {
                                                            "type": "string",
                                                            "example": "Sender Name"
                                                        },
                                                        "created": {
                                                            "type": "string",
                                                            "example": "2020-06-23 14:06:25"
                                                        }
                                                    }
                                                },
                                                "sent": {
                                                    "type": "integer",
                                                    "example": 500
                                                },
                                                "delivered": {
                                                    "type": "integer",
                                                    "example": 490
                                                },
                                                "opened": {
                                                    "type": "integer",
                                                    "example": 200
                                                },
                                                "clicked": {
                                                    "type": "integer",
                                                    "example": 50
                                                },
                                                "errors": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "unsubscribed": {
                                                    "type": "integer",
                                                    "example": 3
                                                },
                                                "marked_as_spam": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 12:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 10,
                                        "task": {
                                            "id": 12018943,
                                            "address_book_id": 0,
                                            "message_title": "Thank you for your order",
                                            "sender_mail_address": "sender@example.com",
                                            "sender_mail_name": "Sender Name",
                                            "created": "2020-06-23 14:06:25"
                                        },
                                        "sent": 500,
                                        "delivered": 490,
                                        "opened": 200,
                                        "clicked": 50,
                                        "errors": 10,
                                        "unsubscribed": 3,
                                        "marked_as_spam": 1,
                                        "expects": 5,
                                        "last_send": "2024-06-01 12:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/email/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Email"
                ],
                "summary": "Get email stats filtered by date range",
                "description": "Returns aggregated email statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.email.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered email summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "sent": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "3"
                                                },
                                                "delivered": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "3"
                                                },
                                                "opened": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "3"
                                                },
                                                "clicked": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2"
                                                },
                                                "errors": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "0"
                                                },
                                                "unsubscribed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "0"
                                                },
                                                "marked_as_spam": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "0"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 12:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "sent": "3",
                                        "delivered": "3",
                                        "opened": "3",
                                        "clicked": "2",
                                        "errors": "0",
                                        "unsubscribed": "0",
                                        "marked_as_spam": "0",
                                        "last_send": "2024-05-16 09:54:52"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/email/{elementId}/addresses": {
            "get": {
                "tags": [
                    "Stats — Email"
                ],
                "summary": "Get per-email stat records",
                "description": "Returns a paginated list of individual email delivery records. Supports filtering by `email`, `send_date_from`, `send_date_to`, and `url_hash` (segmentation filter fields).",
                "operationId": "stats.email.addresses",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/SortDirectionParam"
                    },
                    {
                        "$ref": "#/components/parameters/SortFieldParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParamOptional"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Paginated list of email stat records",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1001
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "example": "user@example.com"
                                                    },
                                                    "email_b64": {
                                                        "type": "string",
                                                        "example": "dXNlckBleGFtcGxlLmNvbQ=="
                                                    },
                                                    "event_id": {
                                                        "type": "string",
                                                        "example": "a1b2c3d4"
                                                    },
                                                    "delivered_status": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 1
                                                    },
                                                    "is_spam": {
                                                        "type": "integer",
                                                        "example": 0
                                                    },
                                                    "is_unsubscribe": {
                                                        "type": "integer",
                                                        "example": 0
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "sent_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 10:00:00"
                                                    },
                                                    "delivered_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 10:05:00"
                                                    },
                                                    "open_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 11:00:00"
                                                    },
                                                    "redirect_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": null
                                                    },
                                                    "updated": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 10:05:00"
                                                    }
                                                }
                                            }
                                        },
                                        "is_next": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 1001,
                                            "email": "user@example.com",
                                            "email_b64": "dXNlckBleGFtcGxlLmNvbQ==",
                                            "event_id": "a1b2c3d4",
                                            "delivered_status": 1,
                                            "is_spam": 0,
                                            "is_unsubscribe": 0,
                                            "phone": null,
                                            "sent_date": "2024-06-01 10:00:00",
                                            "delivered_date": "2024-06-01 10:05:00",
                                            "open_date": "2024-06-01 11:00:00",
                                            "redirect_date": null,
                                            "updated": "2024-06-01 10:05:00"
                                        }
                                    ],
                                    "is_next": true
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/sms/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — SMS"
                ],
                "summary": "Get SMS summary stats",
                "description": "Returns aggregated SMS statistics for the automation flow.",
                "operationId": "stats.sms.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Aggregated SMS summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 300
                                                },
                                                "sent": {
                                                    "type": "integer",
                                                    "example": 295
                                                },
                                                "delivered": {
                                                    "type": "integer",
                                                    "example": 290
                                                },
                                                "errors": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 2
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 11:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 10,
                                        "executed": 300,
                                        "sent": 295,
                                        "delivered": 290,
                                        "errors": 5,
                                        "expects": 2,
                                        "last_send": "2024-06-01 11:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/sms/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — SMS"
                ],
                "summary": "Get SMS stats filtered by date range",
                "description": "Returns aggregated SMS statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.sms.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered SMS summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "300"
                                                },
                                                "sent": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "150"
                                                },
                                                "delivered": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "148"
                                                },
                                                "errors": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 11:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "300",
                                        "sent": "150",
                                        "delivered": "148",
                                        "errors": "2",
                                        "last_send": "2024-06-01 11:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/sms/{elementId}/addresses": {
            "get": {
                "tags": [
                    "Stats — SMS"
                ],
                "summary": "Get per-contact SMS stat records",
                "description": "Returns a paginated list of individual SMS delivery records for the flow.",
                "operationId": "stats.sms.addresses",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/SortDirectionParam"
                    },
                    {
                        "$ref": "#/components/parameters/SortFieldParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParamOptional"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Paginated SMS delivery records",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 501
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "status": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 1
                                                    },
                                                    "event_id": {
                                                        "type": "string",
                                                        "example": "a1b2c3d4"
                                                    },
                                                    "sender": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "MyBrand"
                                                    },
                                                    "send_id": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 999
                                                    },
                                                    "body": {
                                                        "type": "string",
                                                        "example": "Hello, your order is ready!"
                                                    },
                                                    "price": {
                                                        "type": "object",
                                                        "nullable": true,
                                                        "description": "Price per currency code (key = ISO currency, value = amount as string)",
                                                        "additionalProperties": {
                                                            "type": "string"
                                                        },
                                                        "example": {
                                                            "USD": "0.07900",
                                                            "EUR": "0.06400",
                                                            "UAH": "1.93000"
                                                        }
                                                    },
                                                    "cur": {
                                                        "type": "string",
                                                        "example": "USD"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "sent_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 11:00:00"
                                                    }
                                                }
                                            }
                                        },
                                        "is_next": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/push/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Push"
                ],
                "summary": "Get push summary stats",
                "description": "Returns aggregated push notification statistics for the automation flow.",
                "operationId": "stats.push.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Aggregated push summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "sent": {
                                                    "type": "integer",
                                                    "example": 150
                                                },
                                                "delivered": {
                                                    "type": "integer",
                                                    "example": 148
                                                },
                                                "clicked": {
                                                    "type": "integer",
                                                    "example": 30
                                                },
                                                "errors": {
                                                    "type": "integer",
                                                    "example": 2
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 10:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 10,
                                        "sent": 150,
                                        "delivered": 148,
                                        "clicked": 30,
                                        "errors": 2,
                                        "expects": 0,
                                        "last_send": "2024-06-01 10:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/push/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Push"
                ],
                "summary": "Get push stats filtered by date range",
                "description": "Returns aggregated push statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.push.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered push summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "sent": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "80"
                                                },
                                                "delivered": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "79"
                                                },
                                                "clicked": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "15"
                                                },
                                                "errors": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "1"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 10:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "sent": "80",
                                        "delivered": "79",
                                        "clicked": "15",
                                        "errors": "1",
                                        "last_send": "2024-06-01 10:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/push/{elementId}/addresses": {
            "get": {
                "tags": [
                    "Stats — Push"
                ],
                "summary": "Get per-contact push stat records",
                "description": "Returns a paginated list of individual push delivery records for the flow.",
                "operationId": "stats.push.addresses",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/SortDirectionParam"
                    },
                    {
                        "$ref": "#/components/parameters/SortFieldParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Paginated push delivery records",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 201
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "email_b64": {
                                                        "type": "string",
                                                        "example": "dXNlckBleGFtcGxlLmNvbQ=="
                                                    },
                                                    "event_id": {
                                                        "type": "string",
                                                        "example": "a1b2c3d4"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "status": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 1
                                                    },
                                                    "is_sent": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "is_delivered": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "is_redirected": {
                                                        "type": "integer",
                                                        "example": 0
                                                    },
                                                    "sent_date": {
                                                        "type": "string",
                                                        "example": "2024-06-01 10:00:00"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        "is_next": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 201,
                                            "email": "user@example.com",
                                            "email_b64": "dXNlckBleGFtcGxlLmNvbQ==",
                                            "event_id": "a1b2c3d4",
                                            "phone": null,
                                            "status": 1,
                                            "is_sent": 1,
                                            "is_delivered": 1,
                                            "is_redirected": 0,
                                            "sent_date": "2024-06-01 10:00:00",
                                            "external_data": []
                                        }
                                    ],
                                    "is_next": false
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/messenger/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Messenger"
                ],
                "summary": "Get messenger summary stats",
                "description": "Returns aggregated chatbot/messenger statistics for the automation flow.",
                "operationId": "stats.messenger.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Aggregated messenger summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 80
                                                },
                                                "sent": {
                                                    "type": "integer",
                                                    "example": 79
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 1
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 09:30:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 10,
                                        "executed": 80,
                                        "sent": 79,
                                        "expects": 1,
                                        "last_send": "2024-06-01 09:30:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/messenger/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Messenger"
                ],
                "summary": "Get messenger stats filtered by date range",
                "description": "Returns aggregated messenger statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.messenger.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered messenger summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "80"
                                                },
                                                "sent": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "40"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 09:30:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "80",
                                        "sent": "40",
                                        "last_send": "2024-06-01 09:30:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/messenger/{elementId}/addresses": {
            "get": {
                "tags": [
                    "Stats — Messenger"
                ],
                "summary": "Get per-contact messenger stat records",
                "description": "Returns a paginated list of individual messenger delivery records for the flow. `limit` and `offset` are required. An optional date-range `filter` can narrow results; an empty date window returns 404.",
                "operationId": "stats.messenger.addresses",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParamOptional"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Paginated messenger delivery records",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 301
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "status": {
                                                        "type": "integer",
                                                        "example": 1
                                                    },
                                                    "event_id": {
                                                        "type": "string",
                                                        "example": "a1b2c3d4ef567890"
                                                    },
                                                    "bot_type": {
                                                        "type": "string",
                                                        "example": "telegram",
                                                        "description": "Messenger channel. Known values: \"telegram\", \"bridge_bot\"."
                                                    },
                                                    "bot_id": {
                                                        "type": "string",
                                                        "example": "66446"
                                                    },
                                                    "chain_id": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "66446"
                                                    },
                                                    "sent_date": {
                                                        "type": "string",
                                                        "example": "2024-06-01 09:30:00"
                                                    }
                                                }
                                            }
                                        },
                                        "is_next": {
                                            "type": "boolean",
                                            "example": false
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 301,
                                            "phone": null,
                                            "email": "user@example.com",
                                            "status": 1,
                                            "event_id": "a1b2c3d4ef567890",
                                            "bot_type": "telegram",
                                            "bot_id": "66446",
                                            "chain_id": null,
                                            "sent_date": "2024-06-01 09:30:00"
                                        }
                                    ],
                                    "is_next": false
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/viber/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Viber"
                ],
                "summary": "Get Viber summary stats",
                "description": "Returns aggregated Viber message statistics for the automation flow.",
                "operationId": "stats.viber.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Aggregated Viber summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 200
                                                },
                                                "sent": {
                                                    "type": "integer",
                                                    "example": 198
                                                },
                                                "opened": {
                                                    "type": "integer",
                                                    "example": 90
                                                },
                                                "delivered": {
                                                    "type": "integer",
                                                    "example": 195
                                                },
                                                "clicked": {
                                                    "type": "integer",
                                                    "example": 40
                                                },
                                                "errors": {
                                                    "type": "integer",
                                                    "example": 3
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 09:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 10,
                                        "executed": 200,
                                        "sent": 198,
                                        "opened": 90,
                                        "delivered": 195,
                                        "clicked": 40,
                                        "errors": 3,
                                        "expects": 0,
                                        "last_send": "2024-06-01 09:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/viber/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Viber"
                ],
                "summary": "Get Viber stats filtered by date range",
                "description": "Returns aggregated Viber statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.viber.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered Viber summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 200
                                                },
                                                "sent": {
                                                    "type": "integer",
                                                    "example": 100
                                                },
                                                "opened": {
                                                    "type": "integer",
                                                    "example": 45
                                                },
                                                "delivered": {
                                                    "type": "integer",
                                                    "example": 98
                                                },
                                                "clicked": {
                                                    "type": "integer",
                                                    "example": 20
                                                },
                                                "errors": {
                                                    "type": "integer",
                                                    "example": 2
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 09:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 10,
                                        "executed": 200,
                                        "sent": 100,
                                        "opened": 45,
                                        "delivered": 98,
                                        "clicked": 20,
                                        "errors": 2,
                                        "last_send": "2024-06-01 09:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/viber/{elementId}/addresses": {
            "get": {
                "tags": [
                    "Stats — Viber"
                ],
                "summary": "Get per-contact Viber stat records",
                "description": "Returns a paginated list of individual Viber delivery records for the flow.",
                "operationId": "stats.viber.addresses",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/SortDirectionParam"
                    },
                    {
                        "$ref": "#/components/parameters/SortFieldParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Paginated Viber delivery records",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 130132
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "example": 380954807324
                                                    },
                                                    "status": {
                                                        "type": "integer",
                                                        "example": 3
                                                    },
                                                    "price": {
                                                        "oneOf": [
                                                            {
                                                                "type": "object",
                                                                "description": "Price per currency code (key = ISO currency, value = amount as number)",
                                                                "additionalProperties": {
                                                                    "type": "number"
                                                                },
                                                                "example": {
                                                                    "USD": 0.014,
                                                                    "UAH": 0.55,
                                                                    "EUR": 0.013
                                                                }
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    },
                                                    "cur": {
                                                        "type": "string",
                                                        "example": "UAH"
                                                    },
                                                    "event_id": {
                                                        "type": "string",
                                                        "example": "ab0ec7508cf745baf4c947d2551b124e"
                                                    },
                                                    "sent_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-08-05 14:47:21"
                                                    }
                                                }
                                            }
                                        },
                                        "is_next": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 130132,
                                            "phone": 380954807324,
                                            "status": 3,
                                            "price": {
                                                "USD": 0.014,
                                                "UAH": 0.55,
                                                "EUR": 0.013
                                            },
                                            "cur": "UAH",
                                            "event_id": "ab0ec7508cf745baf4c947d2551b124e",
                                            "sent_date": "2024-08-05 14:47:21"
                                        }
                                    ],
                                    "is_next": false
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/filter/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Filter"
                ],
                "summary": "Get filter operator summary stats",
                "description": "Returns aggregated statistics for a filter operator node: executed, positive, negative, stopped counts.",
                "operationId": "stats.filter.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Filter operator summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 20
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 500
                                                },
                                                "positive": {
                                                    "type": "integer",
                                                    "example": 300
                                                },
                                                "negative": {
                                                    "type": "integer",
                                                    "example": 190
                                                },
                                                "stopped": {
                                                    "type": "integer",
                                                    "example": 10
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 12:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 20,
                                        "executed": 500,
                                        "positive": 300,
                                        "negative": 190,
                                        "stopped": 10,
                                        "expects": 0,
                                        "last_send": "2024-06-01 12:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/filter/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Filter"
                ],
                "summary": "Get filter stats filtered by date range",
                "description": "Returns aggregated filter operator statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.filter.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered filter operator summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "250"
                                                },
                                                "positive": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "150"
                                                },
                                                "negative": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "95"
                                                },
                                                "stopped": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "5"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 12:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "250",
                                        "positive": "150",
                                        "negative": "95",
                                        "stopped": "5",
                                        "last_send": "2024-06-01 12:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/trigger/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Condition"
                ],
                "summary": "Get condition element summary stats",
                "description": "Returns aggregated statistics for a condition (trigger) element: executed, positive (passed), negative (filtered out) counts.",
                "operationId": "stats.trigger.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Condition element summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 25
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 400
                                                },
                                                "positive": {
                                                    "type": "integer",
                                                    "example": 350
                                                },
                                                "negative": {
                                                    "type": "integer",
                                                    "example": 50
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 14:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 25,
                                        "executed": 400,
                                        "positive": 350,
                                        "negative": 50,
                                        "expects": 0,
                                        "last_send": "2024-06-01 14:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/trigger/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Condition"
                ],
                "summary": "Get condition element stats filtered by date range",
                "description": "Returns aggregated condition element statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "stats.trigger.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered condition element summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "example": "5"
                                                },
                                                "positive": {
                                                    "type": "string",
                                                    "example": "5"
                                                },
                                                "negative": {
                                                    "type": "string",
                                                    "example": "0"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-03 14:50:35"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "5",
                                        "positive": "5",
                                        "negative": "0",
                                        "last_send": "2024-06-03 14:50:35"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/action/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Action"
                ],
                "summary": "Get action operator summary stats",
                "description": "Returns aggregated statistics for an action operator node (e.g. set variable, add to list). Returns executed count and expects.",
                "operationId": "stats.action.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Action operator summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 30
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 1000
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 5
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 15:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 30,
                                        "executed": 1000,
                                        "expects": 5,
                                        "last_send": "2024-06-01 15:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/action/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Action"
                ],
                "summary": "Get action stats filtered by date range",
                "description": "Returns action operator statistics filtered by the segmentation date range. Returns 404 if no executions in the range.",
                "operationId": "stats.action.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered action summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "500"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 15:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "500",
                                        "last_send": "2024-06-01 15:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/goal/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Goal"
                ],
                "summary": "Get goal operator summary stats",
                "description": "Returns aggregated statistics for a goal operator node. Returns executed count (how many contacts reached this goal) and expects.",
                "operationId": "stats.goal.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Goal operator summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 35
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 37
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 16:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 35,
                                        "executed": 37,
                                        "expects": 0,
                                        "last_send": "2024-06-01 16:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/goal/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Goal"
                ],
                "summary": "Get goal stats filtered by date range",
                "description": "Returns goal operator statistics filtered by the segmentation date range. Returns 404 if no executions in the range.",
                "operationId": "stats.goal.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered goal summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "20"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 16:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "20",
                                        "last_send": "2024-06-01 16:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/pause/{elementId}/group-stat": {
            "get": {
                "tags": [
                    "Stats — Pause"
                ],
                "summary": "Get pause operator summary stats",
                "description": "Returns aggregated statistics for a pause (delay) operator node. Returns executed count (how many contacts have passed through the pause) and expects (currently waiting).",
                "operationId": "stats.pause.groupStat",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Pause operator summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "flow_id": {
                                                    "type": "integer",
                                                    "example": 40
                                                },
                                                "executed": {
                                                    "type": "integer",
                                                    "example": 450
                                                },
                                                "expects": {
                                                    "type": "integer",
                                                    "example": 12
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 13:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "flow_id": 40,
                                        "executed": 450,
                                        "expects": 12,
                                        "last_send": "2024-06-01 13:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/pause/{elementId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Stats — Pause"
                ],
                "summary": "Get pause stats filtered by date range",
                "description": "Returns pause operator statistics filtered by the segmentation date range. Returns 404 if no executions in the range.",
                "operationId": "stats.pause.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered pause summary",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "executed": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "200"
                                                },
                                                "last_send": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "example": "2024-06-01 13:00:00"
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "executed": "200",
                                        "last_send": "2024-06-01 13:00:00"
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/stats/flow-operator/{elementId}/addresses": {
            "get": {
                "tags": [
                    "Stats — Flow Operator"
                ],
                "summary": "Get per-contact flow operator stat records",
                "description": "Returns a paginated list of contacts that passed through the flow operator node.",
                "operationId": "stats.flowOperator.addresses",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/ElementIdParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParamOptional"
                    },
                    {
                        "name": "sortField",
                        "in": "query",
                        "required": false,
                        "description": "Field to sort by. If omitted, no sorting is applied and rows are returned in storage order.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "event_id",
                                "execution_date"
                            ]
                        }
                    },
                    {
                        "name": "sortDirection",
                        "in": "query",
                        "required": false,
                        "description": "Sort direction. Takes effect only together with sortField. When sortField is set and this parameter is omitted, asc is used.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Paginated flow operator contact records",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "event_id": {
                                                        "type": "string",
                                                        "example": "a1b2c3d4"
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "email_b64": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "dXNlckBleGFtcGxlLmNvbQ=="
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "execution_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 12:00:00"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        "is_next": {
                                            "type": "boolean",
                                            "example": true
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "event_id": "a1b2c3d4",
                                            "email": "user@example.com",
                                            "email_b64": "dXNlckBleGFtcGxlLmNvbQ==",
                                            "phone": null,
                                            "execution_date": "2024-06-01 12:00:00",
                                            "external_data": []
                                        }
                                    ],
                                    "is_next": true
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/list": {
            "get": {
                "tags": [
                    "Autoresponders"
                ],
                "summary": "List all automations",
                "description": "Returns a paginated list of automations for the authenticated user.",
                "operationId": "autoresponders.list",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "$ref": "#/components/parameters/LimitParam"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "422": {
                        "$ref": "#/components/responses/UnprocessableEntityResponse"
                    },
                    "200": {
                        "description": "Paginated list of automations",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "allOf": [
                                                    {
                                                        "$ref": "#/components/schemas/AutoresponderItem"
                                                    },
                                                    {
                                                        "type": "object",
                                                        "properties": {
                                                            "user_id": {
                                                                "type": "integer",
                                                                "example": 8662602
                                                            },
                                                            "main_data": {
                                                                "type": "object",
                                                                "nullable": true,
                                                                "description": "Automation configuration and aggregate statistics. null for legacy \"series\" automations.",
                                                                "properties": {
                                                                    "automation_name": {
                                                                        "type": "string",
                                                                        "example": "Welcome series"
                                                                    },
                                                                    "status": {
                                                                        "type": "integer",
                                                                        "example": 1
                                                                    },
                                                                    "real_id": {
                                                                        "type": "integer",
                                                                        "example": 25417
                                                                    },
                                                                    "address_book_id": {
                                                                        "oneOf": [
                                                                            {
                                                                                "type": "integer"
                                                                            },
                                                                            {
                                                                                "type": "string"
                                                                            }
                                                                        ],
                                                                        "example": 0
                                                                    },
                                                                    "start_var_id": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "new_variables_info": {
                                                                        "oneOf": [
                                                                            {
                                                                                "type": "array",
                                                                                "items": {
                                                                                    "type": "object"
                                                                                }
                                                                            },
                                                                            {
                                                                                "type": "object"
                                                                            }
                                                                        ],
                                                                        "example": []
                                                                    },
                                                                    "sender_email_id": {
                                                                        "oneOf": [
                                                                            {
                                                                                "type": "integer"
                                                                            },
                                                                            {
                                                                                "type": "string"
                                                                            }
                                                                        ],
                                                                        "example": 0
                                                                    },
                                                                    "sender_email_address": {
                                                                        "type": "string",
                                                                        "example": "sender@example.com"
                                                                    },
                                                                    "sender_email_name": {
                                                                        "type": "string",
                                                                        "example": "Sender Name"
                                                                    },
                                                                    "push_site": {
                                                                        "oneOf": [
                                                                            {
                                                                                "type": "integer"
                                                                            },
                                                                            {
                                                                                "type": "string"
                                                                            }
                                                                        ],
                                                                        "example": 0
                                                                    },
                                                                    "push_site_url": {
                                                                        "type": "string",
                                                                        "example": ""
                                                                    },
                                                                    "sent_time_hour": {
                                                                        "type": "string",
                                                                        "example": "0"
                                                                    },
                                                                    "sent_time_min": {
                                                                        "type": "string",
                                                                        "example": "0"
                                                                    },
                                                                    "aWeekDays": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "integer"
                                                                        },
                                                                        "example": [
                                                                            0,
                                                                            1,
                                                                            2,
                                                                            3,
                                                                            4,
                                                                            5,
                                                                            6
                                                                        ]
                                                                    },
                                                                    "external_stat": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "utm_medium": {
                                                                        "type": "string",
                                                                        "example": ""
                                                                    },
                                                                    "utm_source": {
                                                                        "type": "string",
                                                                        "example": ""
                                                                    },
                                                                    "utm_campaign": {
                                                                        "type": "string",
                                                                        "example": ""
                                                                    },
                                                                    "utm_term": {
                                                                        "type": "string",
                                                                        "example": ""
                                                                    },
                                                                    "utm_content": {
                                                                        "type": "string",
                                                                        "example": ""
                                                                    },
                                                                    "unsubscribe_link_lang": {
                                                                        "type": "string",
                                                                        "example": "en"
                                                                    },
                                                                    "unsubscribe_page_id": {
                                                                        "type": "integer",
                                                                        "nullable": true,
                                                                        "example": 0
                                                                    },
                                                                    "unsubscribe_category_id": {
                                                                        "type": "integer",
                                                                        "nullable": true,
                                                                        "example": 0
                                                                    },
                                                                    "utm_campaign_uniq": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "check_open_email": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "check_redirect_link": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "start_event_id": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "sub_abook_id": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "stop_events_ids": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "integer"
                                                                        },
                                                                        "example": []
                                                                    },
                                                                    "template_lang": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": "en"
                                                                    },
                                                                    "template_segment": {
                                                                        "nullable": true,
                                                                        "oneOf": [
                                                                            {
                                                                                "type": "string"
                                                                            },
                                                                            {
                                                                                "type": "array",
                                                                                "items": {
                                                                                    "type": "object"
                                                                                }
                                                                            }
                                                                        ],
                                                                        "example": null
                                                                    },
                                                                    "template_description": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": null
                                                                    },
                                                                    "push_filters": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "object"
                                                                        },
                                                                        "example": []
                                                                    },
                                                                    "date_created": {
                                                                        "type": "string",
                                                                        "example": "2024-01-01 09:00:00"
                                                                    },
                                                                    "template_preview": {
                                                                        "type": "string",
                                                                        "example": "https://example.com/preview.png"
                                                                    },
                                                                    "summ_sent": {
                                                                        "type": "integer",
                                                                        "example": 100
                                                                    },
                                                                    "summ_sent_email": {
                                                                        "type": "integer",
                                                                        "example": 80
                                                                    },
                                                                    "summ_sent_sms": {
                                                                        "type": "integer",
                                                                        "example": 10
                                                                    },
                                                                    "summ_sent_push": {
                                                                        "type": "integer",
                                                                        "example": 10
                                                                    },
                                                                    "summ_stat_email": {
                                                                        "type": "integer",
                                                                        "example": 80
                                                                    },
                                                                    "summ_stat_push": {
                                                                        "type": "integer",
                                                                        "example": 10
                                                                    },
                                                                    "cnt_op_email": {
                                                                        "type": "integer",
                                                                        "example": 3
                                                                    },
                                                                    "cnt_op_sms": {
                                                                        "type": "integer",
                                                                        "example": 1
                                                                    },
                                                                    "cnt_op_push": {
                                                                        "type": "integer",
                                                                        "example": 1
                                                                    },
                                                                    "cnt_op_messenger": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "cnt_op_viber": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "queue": {
                                                                        "type": "integer",
                                                                        "example": 5
                                                                    },
                                                                    "completed": {
                                                                        "type": "integer",
                                                                        "example": 95
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                ]
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": [
                                        {
                                            "id": 1,
                                            "name": "Welcome series",
                                            "status": 1,
                                            "created": "2024-01-01 09:00:00",
                                            "changed": "2024-01-01 09:00:00",
                                            "user_id": 8662602,
                                            "main_data": {
                                                "automation_name": "Welcome series",
                                                "status": 1,
                                                "real_id": 25417,
                                                "address_book_id": 0,
                                                "start_var_id": 0,
                                                "new_variables_info": [],
                                                "sender_email_id": 0,
                                                "sender_email_address": "sender@example.com",
                                                "sender_email_name": "Sender Name",
                                                "push_site": 0,
                                                "push_site_url": "",
                                                "sent_time_hour": "0",
                                                "sent_time_min": "0",
                                                "aWeekDays": [
                                                    0,
                                                    1,
                                                    2,
                                                    3,
                                                    4,
                                                    5,
                                                    6
                                                ],
                                                "external_stat": 0,
                                                "utm_medium": "",
                                                "utm_source": "",
                                                "utm_campaign": "",
                                                "utm_term": "",
                                                "utm_content": "",
                                                "unsubscribe_link_lang": "en",
                                                "unsubscribe_page_id": 0,
                                                "unsubscribe_category_id": 0,
                                                "utm_campaign_uniq": 0,
                                                "check_open_email": 0,
                                                "check_redirect_link": 0,
                                                "start_event_id": 0,
                                                "sub_abook_id": 0,
                                                "stop_events_ids": [],
                                                "template_lang": "en",
                                                "template_segment": null,
                                                "template_description": null,
                                                "push_filters": [],
                                                "date_created": "2024-01-01 09:00:00",
                                                "summ_sent": 100,
                                                "summ_sent_email": 80,
                                                "summ_sent_sms": 10,
                                                "summ_sent_push": 10,
                                                "summ_stat_email": 80,
                                                "summ_stat_push": 10,
                                                "cnt_op_email": 3,
                                                "cnt_op_sms": 1,
                                                "cnt_op_push": 1,
                                                "cnt_op_messenger": 0,
                                                "cnt_op_viber": 0,
                                                "queue": 5,
                                                "completed": 95
                                            }
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}": {
            "get": {
                "tags": [
                    "Autoresponders"
                ],
                "summary": "Get statistics about an automation flow",
                "description": "Returns the full automation overview: autoresponder info, its operator flows, and aggregate statistics (starts, in_queue, end_count, send_messages, conversions).",
                "operationId": "autoresponders.index",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Automation overview",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "autoresponder": {
                                            "$ref": "#/components/schemas/AutoresponderItem"
                                        },
                                        "flows": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1906432,
                                                        "description": "Element ID — use this as id in /stats/* endpoints"
                                                    },
                                                    "main_id": {
                                                        "type": "integer",
                                                        "example": 25417
                                                    },
                                                    "af_type": {
                                                        "type": "string",
                                                        "example": "email",
                                                        "enum": [
                                                            "maintrigger",
                                                            "email",
                                                            "trigger",
                                                            "action",
                                                            "sms",
                                                            "filter",
                                                            "push",
                                                            "goal",
                                                            "viber",
                                                            "pause",
                                                            "messenger"
                                                        ],
                                                        "description": "Element type. Determines which /stats/* family to call: maintrigger → /stats/main-trigger, email → /stats/email, trigger → /stats/trigger, action → /stats/action, sms → /stats/sms, filter → /stats/filter, push → /stats/push, goal → /stats/goal, viber → /stats/viber, pause → /stats/pause, messenger → /stats/messenger"
                                                    },
                                                    "created": {
                                                        "type": "string",
                                                        "example": "2024-05-15 18:16:31"
                                                    },
                                                    "last_send": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:54:52"
                                                    },
                                                    "task": {
                                                        "nullable": true,
                                                        "description": "Operator task details. Shape depends on af_type. null for non-message elements (maintrigger, trigger, filter, goal, pause, action).",
                                                        "oneOf": [
                                                            {
                                                                "type": "object",
                                                                "description": "Email task (af_type = email)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 689497
                                                                    },
                                                                    "address_book_id": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "message_title": {
                                                                        "type": "string",
                                                                        "example": "Subject line"
                                                                    },
                                                                    "sender_mail_address": {
                                                                        "type": "string",
                                                                        "example": "sender@example.com"
                                                                    },
                                                                    "sender_mail_name": {
                                                                        "type": "string",
                                                                        "example": "Sender Name"
                                                                    },
                                                                    "created": {
                                                                        "type": "string",
                                                                        "example": "2024-05-15 18:16:31"
                                                                    }
                                                                }
                                                            },
                                                            {
                                                                "type": "object",
                                                                "description": "Push task (af_type = push)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 123
                                                                    },
                                                                    "website_id": {
                                                                        "type": "integer",
                                                                        "example": 45
                                                                    },
                                                                    "title": {
                                                                        "type": "string",
                                                                        "example": "Notification title"
                                                                    },
                                                                    "body": {
                                                                        "type": "string",
                                                                        "example": "Notification body"
                                                                    },
                                                                    "icon": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": null
                                                                    },
                                                                    "url_for_click": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": "https://example.com"
                                                                    },
                                                                    "created": {
                                                                        "type": "string",
                                                                        "example": "2024-05-15 18:16:31"
                                                                    }
                                                                }
                                                            },
                                                            {
                                                                "type": "object",
                                                                "description": "SMS task (af_type = sms)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 456
                                                                    },
                                                                    "address_book_id": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "sms_body": {
                                                                        "type": "string",
                                                                        "example": "SMS text"
                                                                    },
                                                                    "sms_sender_name": {
                                                                        "type": "string",
                                                                        "example": "Sender"
                                                                    },
                                                                    "created": {
                                                                        "type": "string",
                                                                        "example": "2024-05-15 18:16:31"
                                                                    }
                                                                }
                                                            },
                                                            {
                                                                "type": "object",
                                                                "description": "Messenger task (af_type = messenger)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 10364
                                                                    },
                                                                    "bot_id": {
                                                                        "type": "string",
                                                                        "example": "66446"
                                                                    },
                                                                    "chain_id": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": "66446"
                                                                    },
                                                                    "message_body": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": "156"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        "starts": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "in_queue": {
                                            "type": "integer",
                                            "example": 0
                                        },
                                        "end_count": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "send_messages": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "conversions": {
                                            "type": "integer",
                                            "example": 2
                                        }
                                    }
                                },
                                "example": {
                                    "autoresponder": {
                                        "id": 25417,
                                        "name": "Автоворонка для курса",
                                        "status": 3,
                                        "created": "2024-05-15 15:16:31",
                                        "changed": "2024-05-15 15:16:31"
                                    },
                                    "flows": [
                                        {
                                            "id": 1906432,
                                            "main_id": 25417,
                                            "af_type": "email",
                                            "created": "2024-05-15 18:16:31",
                                            "last_send": "2024-05-16 09:54:52",
                                            "task": {
                                                "id": 689497,
                                                "address_book_id": 0,
                                                "message_title": "Це наша тема для розсилки",
                                                "sender_mail_address": "sender@example.com",
                                                "sender_mail_name": "workingmail",
                                                "created": "2024-05-15 18:16:31"
                                            }
                                        },
                                        {
                                            "id": 1906433,
                                            "main_id": 25417,
                                            "af_type": "maintrigger",
                                            "created": "2024-05-15 18:16:31",
                                            "last_send": null,
                                            "task": null
                                        }
                                    ],
                                    "starts": 3,
                                    "in_queue": 0,
                                    "end_count": 3,
                                    "send_messages": 3,
                                    "conversions": 2
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Autoresponders"
                ],
                "summary": "Get automation stats filtered by date range",
                "description": "Returns aggregated automation statistics filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "autoresponders.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered automation overview",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "autoresponder": {
                                            "$ref": "#/components/schemas/AutoresponderItem"
                                        },
                                        "flows": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 1906431
                                                    },
                                                    "main_id": {
                                                        "type": "integer",
                                                        "example": 25417
                                                    },
                                                    "af_type": {
                                                        "type": "string",
                                                        "example": "maintrigger"
                                                    },
                                                    "created": {
                                                        "type": "string",
                                                        "example": "2024-05-15 18:16:31"
                                                    },
                                                    "last_send": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:54:51"
                                                    },
                                                    "task": {
                                                        "nullable": true,
                                                        "description": "Operator task details. Shape depends on af_type. null for non-message elements (maintrigger, trigger, filter, goal, pause, action).",
                                                        "oneOf": [
                                                            {
                                                                "type": "object",
                                                                "description": "Email task (af_type = email)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 689497
                                                                    },
                                                                    "address_book_id": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "message_title": {
                                                                        "type": "string",
                                                                        "example": "Subject line"
                                                                    },
                                                                    "sender_mail_address": {
                                                                        "type": "string",
                                                                        "example": "sender@example.com"
                                                                    },
                                                                    "sender_mail_name": {
                                                                        "type": "string",
                                                                        "example": "Sender Name"
                                                                    },
                                                                    "created": {
                                                                        "type": "string",
                                                                        "example": "2024-05-15 18:16:31"
                                                                    }
                                                                }
                                                            },
                                                            {
                                                                "type": "object",
                                                                "description": "Push task (af_type = push)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 123
                                                                    },
                                                                    "website_id": {
                                                                        "type": "integer",
                                                                        "example": 45
                                                                    },
                                                                    "title": {
                                                                        "type": "string",
                                                                        "example": "Notification title"
                                                                    },
                                                                    "body": {
                                                                        "type": "string",
                                                                        "example": "Notification body"
                                                                    },
                                                                    "icon": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": null
                                                                    },
                                                                    "url_for_click": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": "https://example.com"
                                                                    },
                                                                    "created": {
                                                                        "type": "string",
                                                                        "example": "2024-05-15 18:16:31"
                                                                    }
                                                                }
                                                            },
                                                            {
                                                                "type": "object",
                                                                "description": "SMS task (af_type = sms)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 456
                                                                    },
                                                                    "address_book_id": {
                                                                        "type": "integer",
                                                                        "example": 0
                                                                    },
                                                                    "sms_body": {
                                                                        "type": "string",
                                                                        "example": "SMS text"
                                                                    },
                                                                    "sms_sender_name": {
                                                                        "type": "string",
                                                                        "example": "Sender"
                                                                    },
                                                                    "created": {
                                                                        "type": "string",
                                                                        "example": "2024-05-15 18:16:31"
                                                                    }
                                                                }
                                                            },
                                                            {
                                                                "type": "object",
                                                                "description": "Messenger task (af_type = messenger)",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "integer",
                                                                        "example": 10364
                                                                    },
                                                                    "bot_id": {
                                                                        "type": "string",
                                                                        "example": "66446"
                                                                    },
                                                                    "chain_id": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": "66446"
                                                                    },
                                                                    "message_body": {
                                                                        "type": "string",
                                                                        "nullable": true,
                                                                        "example": "156"
                                                                    }
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        },
                                        "starts": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "in_queue": {
                                            "type": "integer",
                                            "example": 0
                                        },
                                        "end_count": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "send_messages": {
                                            "type": "integer",
                                            "example": 3
                                        },
                                        "conversions": {
                                            "type": "integer",
                                            "example": 2
                                        }
                                    }
                                },
                                "example": {
                                    "autoresponder": {
                                        "id": 25417,
                                        "name": "Автоворонка для курса",
                                        "status": 3,
                                        "created": "2024-05-15 15:16:31",
                                        "changed": "2024-05-15 15:16:31"
                                    },
                                    "flows": [
                                        {
                                            "id": 1906431,
                                            "main_id": 25417,
                                            "af_type": "maintrigger",
                                            "created": "2024-05-15 18:16:31",
                                            "last_send": "2024-05-16 09:54:51",
                                            "task": null
                                        },
                                        {
                                            "id": 1906432,
                                            "main_id": 25417,
                                            "af_type": "email",
                                            "created": "2024-05-15 18:16:31",
                                            "last_send": "2024-05-16 09:54:52",
                                            "task": {
                                                "id": 689497,
                                                "address_book_id": 0,
                                                "message_title": "Це наша тема для розсилки",
                                                "sender_mail_address": "sender@example.com",
                                                "sender_mail_name": "workingmail",
                                                "created": "2024-05-15 18:16:31"
                                            }
                                        }
                                    ],
                                    "starts": 3,
                                    "in_queue": 0,
                                    "end_count": 3,
                                    "send_messages": 3,
                                    "conversions": 2
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/total-stats": {
            "get": {
                "tags": [
                    "Autoresponders"
                ],
                "summary": "Get total automation stats",
                "description": "Returns the total aggregate statistics for all flows within the automation.",
                "operationId": "autoresponders.totalStats",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "flow_type",
                        "in": "query",
                        "required": false,
                        "description": "Filter stats by element type",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "maintrigger",
                                "email",
                                "push",
                                "sms",
                                "filter",
                                "action",
                                "goal",
                                "trigger",
                                "viber",
                                "pause",
                                "messenger"
                            ]
                        }
                    },
                    {
                        "name": "deleted",
                        "in": "query",
                        "required": false,
                        "description": "Pass 1 to include deleted flow elements",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "1"
                            ]
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Total automation stats",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "autoresponder": {
                                            "$ref": "#/components/schemas/AutoresponderItem"
                                        },
                                        "flows": {
                                            "type": "array",
                                            "description": "Per-element aggregate stats. Schema varies by element type (discriminated by the type field).",
                                            "items": {
                                                "discriminator": {
                                                    "propertyName": "type"
                                                },
                                                "oneOf": [
                                                    {
                                                        "title": "maintrigger",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "maintrigger"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906431
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-16 09:54:51"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "deleted": {
                                                                "type": "integer",
                                                                "example": 0
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "email",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "email"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906432
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-16 09:54:52"
                                                            },
                                                            "sent": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "error": {
                                                                "type": "integer",
                                                                "example": 0
                                                            },
                                                            "opened": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "clicked": {
                                                                "type": "integer",
                                                                "example": 2
                                                            },
                                                            "marked_as_spam": {
                                                                "type": "integer",
                                                                "example": 0
                                                            },
                                                            "unsubscribed": {
                                                                "type": "integer",
                                                                "example": 0
                                                            },
                                                            "delivered": {
                                                                "type": "integer",
                                                                "example": 3
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "trigger",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "trigger"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906433
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-16 10:00:17"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "positive": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "negative": {
                                                                "type": "integer",
                                                                "example": 2
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "filter",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "filter"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906193
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-15 14:51:40"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 4
                                                            },
                                                            "positive": {
                                                                "type": "integer",
                                                                "example": 2
                                                            },
                                                            "negative": {
                                                                "type": "integer",
                                                                "example": 0
                                                            },
                                                            "stopped": {
                                                                "type": "integer",
                                                                "example": 2
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "action",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "action"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906199
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-15 14:39:01"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 2
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "goal",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "goal"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906434
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-16 09:52:35"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 1
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "pause",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "pause"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906194
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-15 14:39:01"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 2
                                                            },
                                                            "errors": {
                                                                "type": "integer",
                                                                "example": 0
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "sms",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "sms"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1907078
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-05-20 11:17:08"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 9
                                                            },
                                                            "sent": {
                                                                "type": "integer",
                                                                "example": 6
                                                            },
                                                            "delivered": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "errors": {
                                                                "type": "integer",
                                                                "example": 3
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "push",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "push"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 2068981
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": null
                                                            },
                                                            "sent": {
                                                                "type": "integer",
                                                                "example": 7
                                                            },
                                                            "delivered": {
                                                                "type": "integer",
                                                                "example": 2
                                                            },
                                                            "clicked": {
                                                                "type": "integer",
                                                                "example": 0
                                                            },
                                                            "errors": {
                                                                "type": "integer",
                                                                "example": 0
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "viber",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "viber"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1963007
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-08-05 14:48:02"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "sent": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "delivered": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "opened": {
                                                                "type": "integer",
                                                                "example": 1
                                                            },
                                                            "clicked": {
                                                                "type": "integer",
                                                                "example": 0
                                                            },
                                                            "errors": {
                                                                "type": "integer",
                                                                "example": 0
                                                            }
                                                        }
                                                    },
                                                    {
                                                        "title": "messenger",
                                                        "type": "object",
                                                        "properties": {
                                                            "type": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "messenger"
                                                                ]
                                                            },
                                                            "flow_id": {
                                                                "type": "integer",
                                                                "example": 1906125
                                                            },
                                                            "status": {
                                                                "type": "integer",
                                                                "example": 3
                                                            },
                                                            "last_send": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "2024-09-24 12:36:01"
                                                            },
                                                            "executed": {
                                                                "type": "integer",
                                                                "example": 9
                                                            },
                                                            "sent": {
                                                                "type": "integer",
                                                                "example": 9
                                                            }
                                                        }
                                                    }
                                                ]
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "autoresponder": {
                                        "id": 25417,
                                        "name": "Автоворонка для курса",
                                        "status": 3,
                                        "created": "2024-05-15 15:16:31",
                                        "changed": "2024-05-15 15:16:31"
                                    },
                                    "flows": [
                                        {
                                            "type": "maintrigger",
                                            "flow_id": 1906431,
                                            "status": 3,
                                            "last_send": "2024-05-16 09:54:51",
                                            "executed": 3,
                                            "deleted": 0
                                        },
                                        {
                                            "type": "email",
                                            "flow_id": 1906432,
                                            "status": 3,
                                            "last_send": "2024-05-16 09:54:52",
                                            "sent": 3,
                                            "error": 0,
                                            "opened": 3,
                                            "clicked": 2,
                                            "marked_as_spam": 0,
                                            "unsubscribed": 0,
                                            "delivered": 3
                                        },
                                        {
                                            "type": "trigger",
                                            "flow_id": 1906433,
                                            "status": 3,
                                            "last_send": "2024-05-16 10:00:17",
                                            "executed": 3,
                                            "positive": 1,
                                            "negative": 2
                                        },
                                        {
                                            "type": "filter",
                                            "flow_id": 1906193,
                                            "status": 3,
                                            "last_send": "2024-05-15 14:51:40",
                                            "executed": 4,
                                            "positive": 2,
                                            "negative": 0,
                                            "stopped": 2
                                        },
                                        {
                                            "type": "action",
                                            "flow_id": 1906199,
                                            "status": 3,
                                            "last_send": "2024-05-15 14:39:01",
                                            "executed": 2
                                        },
                                        {
                                            "type": "goal",
                                            "flow_id": 1906434,
                                            "status": 3,
                                            "last_send": "2024-05-16 09:52:35",
                                            "executed": 1
                                        },
                                        {
                                            "type": "pause",
                                            "flow_id": 1906194,
                                            "status": 3,
                                            "last_send": "2024-05-15 14:39:01",
                                            "executed": 2,
                                            "errors": 0
                                        },
                                        {
                                            "type": "sms",
                                            "flow_id": 1907078,
                                            "status": 3,
                                            "last_send": "2024-05-20 11:17:08",
                                            "executed": 9,
                                            "sent": 6,
                                            "delivered": 3,
                                            "errors": 3
                                        },
                                        {
                                            "type": "push",
                                            "flow_id": 2068981,
                                            "status": 3,
                                            "last_send": null,
                                            "sent": 7,
                                            "delivered": 2,
                                            "clicked": 0,
                                            "errors": 0
                                        },
                                        {
                                            "type": "viber",
                                            "flow_id": 1963007,
                                            "status": 3,
                                            "last_send": "2024-08-05 14:48:02",
                                            "executed": 1,
                                            "sent": 1,
                                            "delivered": 1,
                                            "opened": 1,
                                            "clicked": 0,
                                            "errors": 0
                                        },
                                        {
                                            "type": "messenger",
                                            "flow_id": 1906125,
                                            "status": 3,
                                            "last_send": "2024-09-24 12:36:01",
                                            "executed": 9,
                                            "sent": 9
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions": {
            "get": {
                "tags": [
                    "Autoresponders"
                ],
                "summary": "Get automation conversion stats",
                "description": "Returns conversion statistics for the automation.",
                "operationId": "autoresponders.conversions",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "200": {
                        "description": "Conversion stats",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "total_conversions": {
                                                    "type": "integer",
                                                    "example": 2
                                                },
                                                "maintrigger_conversions": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "goal_conversions": {
                                                    "type": "integer",
                                                    "example": 2
                                                },
                                                "maintrigger": {
                                                    "type": "object",
                                                    "description": "Single maintrigger element with its conversion count",
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer",
                                                            "example": 1906431
                                                        },
                                                        "main_id": {
                                                            "type": "integer",
                                                            "example": 25417
                                                        },
                                                        "af_type": {
                                                            "type": "string",
                                                            "example": "maintrigger"
                                                        },
                                                        "created": {
                                                            "type": "string",
                                                            "example": "2024-05-15 18:16:31"
                                                        },
                                                        "last_send": {
                                                            "type": "string",
                                                            "nullable": true,
                                                            "example": "2024-05-16 09:54:51"
                                                        },
                                                        "task": {
                                                            "type": "object",
                                                            "nullable": true,
                                                            "example": null
                                                        },
                                                        "conversions": {
                                                            "type": "integer",
                                                            "example": 0
                                                        }
                                                    }
                                                },
                                                "goals": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 1906434
                                                            },
                                                            "name": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "Goal 1"
                                                            },
                                                            "main_id": {
                                                                "type": "integer",
                                                                "example": 25417
                                                            },
                                                            "af_type": {
                                                                "type": "string",
                                                                "example": "goal"
                                                            },
                                                            "created": {
                                                                "type": "string",
                                                                "example": "2024-05-15 18:16:31"
                                                            },
                                                            "conversions": {
                                                                "type": "integer",
                                                                "example": 2
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "total_conversions": 2,
                                        "maintrigger_conversions": 0,
                                        "goal_conversions": 2,
                                        "maintrigger": {
                                            "id": 1906431,
                                            "main_id": 25417,
                                            "af_type": "maintrigger",
                                            "created": "2024-05-15 18:16:31",
                                            "last_send": "2024-05-16 09:54:51",
                                            "task": null,
                                            "conversions": 0
                                        },
                                        "goals": [
                                            {
                                                "id": 1906434,
                                                "name": "Goal 1",
                                                "main_id": 25417,
                                                "af_type": "goal",
                                                "created": "2024-05-15 18:16:31",
                                                "conversions": 2
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/group-stat-filtered": {
            "get": {
                "tags": [
                    "Autoresponders"
                ],
                "summary": "Get conversion stats filtered by date range",
                "description": "Returns conversion statistics for the automation filtered by a date range. Pass a URL-encoded JSON segmentation filter as `filter`. Example: `{\"type\":\"group\",\"expression\":\"and\",\"fields\":{\"send_date_from\":{\"name\":\"user_stat_date\",\"expression\":\"gte\",\"value\":\"2026-01-01\"},\"send_date_to\":{\"name\":\"user_stat_date\",\"expression\":\"lte\",\"value\":\"2026-12-31\"}}}`.",
                "operationId": "autoresponders.conversionsGroupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered conversion stats",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "total_conversions": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "maintrigger_conversions": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "goal_conversions": {
                                                    "type": "integer",
                                                    "example": 0
                                                },
                                                "maintrigger": {
                                                    "oneOf": [
                                                        {
                                                            "type": "object",
                                                            "description": "Returned when at least one conversion exists in the filtered period (total_conversions > 0).",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer",
                                                                    "example": 1906431
                                                                },
                                                                "main_id": {
                                                                    "type": "integer",
                                                                    "example": 25417
                                                                },
                                                                "af_type": {
                                                                    "type": "string",
                                                                    "example": "maintrigger"
                                                                },
                                                                "created": {
                                                                    "type": "string",
                                                                    "example": "2024-05-15 18:16:31"
                                                                },
                                                                "last_send": {
                                                                    "type": "string",
                                                                    "nullable": true,
                                                                    "example": null
                                                                },
                                                                "task": {
                                                                    "type": "object",
                                                                    "nullable": true,
                                                                    "example": null
                                                                },
                                                                "conversions": {
                                                                    "type": "integer",
                                                                    "example": 0
                                                                }
                                                            }
                                                        },
                                                        {
                                                            "type": "array",
                                                            "maxItems": 0,
                                                            "description": "Empty array — returned when total_conversions = 0 for the filtered period."
                                                        }
                                                    ]
                                                },
                                                "goals": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer",
                                                                "example": 1906434
                                                            },
                                                            "name": {
                                                                "type": "string",
                                                                "nullable": true,
                                                                "example": "Goal 1"
                                                            },
                                                            "main_id": {
                                                                "type": "integer",
                                                                "example": 25417
                                                            },
                                                            "af_type": {
                                                                "type": "string",
                                                                "example": "goal"
                                                            },
                                                            "created": {
                                                                "type": "string",
                                                                "example": "2024-05-15 18:16:31"
                                                            },
                                                            "conversions": {
                                                                "type": "integer",
                                                                "example": 2
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "data": {
                                        "total_conversions": 2,
                                        "maintrigger_conversions": 0,
                                        "goal_conversions": 2,
                                        "maintrigger": {
                                            "id": 1906431,
                                            "main_id": 25417,
                                            "af_type": "maintrigger",
                                            "created": "2024-05-15 18:16:31",
                                            "last_send": null,
                                            "task": null,
                                            "conversions": 0
                                        },
                                        "goals": [
                                            {
                                                "id": 1906434,
                                                "name": "Goal 1",
                                                "main_id": 25417,
                                                "af_type": "goal",
                                                "created": "2024-05-15 18:16:31",
                                                "conversions": 2
                                            }
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/all": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "List all conversions",
                "description": "Returns all conversion events (goal completions + event-action conversions) for the automation.",
                "operationId": "autoresponders.conversions.all",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamConversions"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "All conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 37
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 15:00:00"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 14:55:00"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-06-01 15:00:00",
                                            "start_date": "2024-06-01 14:55:00",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/maintrigger": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "List main trigger conversions",
                "description": "Returns conversion events attributed to the main trigger (entry point) of the automation.",
                "operationId": "autoresponders.conversions.mainTrigger",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamConversions"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Main trigger conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 37
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 15:00:00"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 14:55:00"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-06-01 15:00:00",
                                            "start_date": "2024-06-01 14:55:00",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/goal": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "List all goal conversions",
                "description": "Returns conversion events attributed to all goal operators in the automation.",
                "operationId": "autoresponders.conversions.goals",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamConversions"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Goal conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 37
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 15:00:00"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 14:55:00"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-06-01 15:00:00",
                                            "start_date": "2024-06-01 14:55:00",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/goal/{goalId}": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "List conversions for a specific goal",
                "description": "Returns conversion events for a specific goal operator node.",
                "operationId": "autoresponders.conversions.goal",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "goalId",
                        "in": "path",
                        "required": true,
                        "description": "Goal ID, you can get in the Get statistics about an automation flow method.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamConversions"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParam"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Specific goal conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 37
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 15:00:00"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-06-01 14:55:00"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-06-01 15:00:00",
                                            "start_date": "2024-06-01 14:55:00",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/all/group-stat-filtered": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "Get all conversions filtered by date range",
                "description": "Returns all conversions for an automation filtered by a date range.",
                "operationId": "conversions.all.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered all conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:52:35"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:51:30"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-05-16 09:52:35",
                                            "start_date": "2024-05-16 09:51:30",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/maintrigger/group-stat-filtered": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "Get main trigger conversions filtered by date range",
                "description": "Returns main trigger conversions filtered by a date range.",
                "operationId": "conversions.mainTrigger.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered main trigger conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:52:35"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:51:30"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-05-16 09:52:35",
                                            "start_date": "2024-05-16 09:51:30",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/goals/group-stat-filtered": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "Get all goals conversions filtered by date range",
                "description": "Returns all goal conversions filtered by a date range.",
                "operationId": "conversions.goals.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered all goals conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:52:35"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:51:30"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-05-16 09:52:35",
                                            "start_date": "2024-05-16 09:51:30",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/autoresponders/{id}/conversions/list/goal/{goalId}/group-stat-filtered": {
            "get": {
                "tags": [
                    "Autoresponders — Conversions"
                ],
                "summary": "Get specific goal conversions filtered by date range",
                "description": "Returns conversions for a specific goal operator node filtered by a date range.",
                "operationId": "conversions.goal.groupStatFiltered",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "Flow ID — you can get it from the flow's URL: /automation/flow/id/{id}. Returned as main_id for each element.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "goalId",
                        "in": "path",
                        "required": true,
                        "description": "Goal ID, you can get in the Get statistics about an automation flow method.",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "$ref": "#/components/parameters/FilterJsonParam"
                    },
                    {
                        "$ref": "#/components/parameters/LimitParamRequired"
                    },
                    {
                        "$ref": "#/components/parameters/OffsetParamRequired"
                    }
                ],
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Filtered specific goal conversions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "total": {
                                            "type": "integer",
                                            "example": 1
                                        },
                                        "items": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer",
                                                        "example": 2310952010
                                                    },
                                                    "conversion_type": {
                                                        "type": "string",
                                                        "example": "goal"
                                                    },
                                                    "flow_id": {
                                                        "type": "integer",
                                                        "example": 1906434
                                                    },
                                                    "email": {
                                                        "type": "string",
                                                        "format": "email",
                                                        "nullable": true,
                                                        "example": "user@example.com"
                                                    },
                                                    "phone": {
                                                        "type": "integer",
                                                        "nullable": true,
                                                        "example": 380632727700
                                                    },
                                                    "conversion_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:52:35"
                                                    },
                                                    "start_date": {
                                                        "type": "string",
                                                        "nullable": true,
                                                        "example": "2024-05-16 09:51:30"
                                                    },
                                                    "external_data": {
                                                        "oneOf": [
                                                            {
                                                                "$ref": "#/components/schemas/ExternalData"
                                                            },
                                                            {
                                                                "type": "array",
                                                                "maxItems": 0
                                                            }
                                                        ]
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                "example": {
                                    "total": 1,
                                    "items": [
                                        {
                                            "id": 2310952010,
                                            "conversion_type": "goal",
                                            "flow_id": 1906434,
                                            "email": "user@example.com",
                                            "phone": null,
                                            "conversion_date": "2024-05-16 09:52:35",
                                            "start_date": "2024-05-16 09:51:30",
                                            "external_data": []
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        },
        "/events/delete-log": {
            "post": {
                "tags": [
                    "Events"
                ],
                "summary": "Delete event log entries",
                "description": "Deletes event log entries matching the provided criteria (by email, phone, external_id, or event_id).",
                "operationId": "events.deleteLog",
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "parameters": [],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "event_id": {
                                        "type": "string",
                                        "example": "a1b2c3d4"
                                    },
                                    "email": {
                                        "type": "string",
                                        "format": "email",
                                        "example": "user@example.com"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "example": "+1234567890"
                                    },
                                    "external_id": {
                                        "type": "string",
                                        "example": "ext-001"
                                    }
                                }
                            },
                            "example": {
                                "email": "user@example.com"
                            }
                        }
                    }
                },
                "responses": {
                    "401": {
                        "$ref": "#/components/responses/UnauthenticatedResponse"
                    },
                    "404": {
                        "$ref": "#/components/responses/NotFoundResponse"
                    },
                    "400": {
                        "$ref": "#/components/responses/ValidationErrorResponse"
                    },
                    "200": {
                        "description": "Log entries deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "result": {
                                            "type": "boolean",
                                            "example": true
                                        },
                                        "message": {
                                            "type": "string",
                                            "example": "ok"
                                        }
                                    }
                                },
                                "example": {
                                    "result": true,
                                    "message": "ok"
                                }
                            }
                        }
                    },
                    "429": {
                        "$ref": "#/components/responses/RateLimitResponse"
                    },
                    "500": {
                        "$ref": "#/components/responses/ServerErrorResponse"
                    }
                }
            }
        }
    }
}