PPanel Edge

bulk-operations

由 openapi.json 自动生成的 17 个端点及其请求、响应和权限元数据。

此参考由已发布 API 契约生成。字段、请求头和权限要求如下。

下载完整 OpenAPI 文档 · SHA-256: ccaa20cec11fad96e369b88073ce3608a5b071ce55d6dc03fa31df7b0f08c525

标识符和数据结构与公开契约一致,说明直接给出调用规则。共享模型见 数据模型.

GET /api/v1/admin/bulk-operations

GET /api/v1/admin/bulk-operations

List bulk operations

{
  "parameters": [
    {
      "in": "query",
      "name": "kind",
      "required": false,
      "schema": {
        "enum": [
          "compensation",
          "notification",
          "marketing"
        ],
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "status",
      "required": false,
      "schema": {
        "enum": [
          "draft",
          "previewed",
          "scheduled",
          "running",
          "paused",
          "completed",
          "cancelled",
          "failed"
        ],
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "cursor",
      "required": false,
      "schema": {
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "page_size",
      "required": false,
      "schema": {
        "default": 20,
        "maximum": 100,
        "minimum": 1,
        "type": "integer"
      }
    },
    {
      "in": "query",
      "name": "include_total",
      "required": false,
      "schema": {
        "default": "false",
        "enum": [
          "true",
          "false"
        ],
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "approval_required",
      "required": false,
      "schema": {
        "enum": [
          "true",
          "false"
        ],
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "has_more": {
                "type": "boolean"
              },
              "items": {
                "items": {
                  "additionalProperties": {},
                  "properties": {
                    "id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "version": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "status",
                    "version"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "total": {
                "type": "number"
              }
            },
            "required": [
              "items",
              "next_cursor",
              "has_more"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation"
    }
  },
  "summary": "List bulk operations",
  "tags": [
    "bulk-operations"
  ],
  "x-body": "none",
  "x-body-limit": 0,
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations

POST /api/v1/admin/bulk-operations

Create a draft bulk operation

{
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "additionalProperties": false,
          "properties": {
            "actions": {
              "items": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "period_count": {
                        "maximum": 3650,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "period_unit": {
                        "enum": [
                          "day",
                          "month",
                          "year"
                        ],
                        "type": "string"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "term_extend"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "period_unit",
                      "period_count"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "traffic_bytes": {
                        "pattern": "^[1-9][0-9]{0,17}$",
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "traffic_bonus"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "traffic_bytes"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "device_delta": {
                        "maximum": 10000,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "expires_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "device_bonus"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "device_delta"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "code_id": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "issue_coupon"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "code_id"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "amount_minor": {
                        "pattern": "^[1-9][0-9]{0,17}$",
                        "type": "string"
                      },
                      "currency": {
                        "pattern": "^[A-Z]{3}$",
                        "type": "string"
                      },
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "gift_credit"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "amount_minor",
                      "currency"
                    ],
                    "type": "object"
                  }
                ]
              },
              "maxItems": 20,
              "type": "array"
            },
            "audience": {
              "oneOf": [
                {
                  "additionalProperties": false,
                  "properties": {
                    "emails": {
                      "default": [],
                      "items": {
                        "format": "email",
                        "type": "string"
                      },
                      "maxItems": 10000,
                      "type": "array"
                    },
                    "type": {
                      "enum": [
                        "list"
                      ],
                      "type": "string"
                    },
                    "user_ids": {
                      "default": [],
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "maxItems": 10000,
                      "type": "array"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "type": "object"
                },
                {
                  "additionalProperties": false,
                  "properties": {
                    "created_from": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "created_to": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "has_active_subscription": {
                      "type": "boolean"
                    },
                    "invited_by": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "locale": {
                      "maxLength": 35,
                      "type": "string"
                    },
                    "node_tags": {
                      "items": {
                        "maxLength": 64,
                        "type": "string"
                      },
                      "maxItems": 100,
                      "type": "array"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "maxItems": 100,
                      "type": "array"
                    },
                    "server_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "maxItems": 100,
                      "type": "array"
                    },
                    "status": {
                      "items": {
                        "enum": [
                          "active",
                          "disabled",
                          "banned",
                          "deactivating",
                          "deleted"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "subscription_ends_from": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "subscription_ends_to": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "subscription_status": {
                      "items": {
                        "enum": [
                          "scheduled",
                          "active",
                          "exhausted",
                          "expired",
                          "cancelled",
                          "refunded"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "type": {
                      "enum": [
                        "query"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "type": "object"
                }
              ]
            },
            "kind": {
              "enum": [
                "compensation",
                "notification",
                "marketing"
              ],
              "type": "string"
            },
            "name": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            },
            "notification": {
              "additionalProperties": false,
              "properties": {
                "channels": {
                  "items": {
                    "enum": [
                      "email",
                      "inbox",
                      "telegram"
                    ],
                    "type": "string"
                  },
                  "maxItems": 3,
                  "minItems": 1,
                  "type": "array"
                },
                "template_key": {
                  "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                  "type": "string"
                },
                "values": {
                  "additionalProperties": {},
                  "default": {},
                  "type": "object"
                }
              },
              "required": [
                "template_key",
                "channels"
              ],
              "type": [
                "object",
                "null"
              ]
            }
          },
          "required": [
            "name",
            "kind",
            "audience",
            "actions",
            "notification"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "responses": {
    "201": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "summary": "Create a draft bulk operation",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.create",
  "x-body": "json",
  "x-body-limit": 1048576,
  "x-concurrency": {
    "etag": true
  },
  "x-idempotency": "required",
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

GET /api/v1/admin/bulk-operations/{id}

GET /api/v1/admin/bulk-operations/{id}

Read a bulk operation

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    }
  },
  "summary": "Read a bulk operation",
  "tags": [
    "bulk-operations"
  ],
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true
  },
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

PATCH /api/v1/admin/bulk-operations/{id}

PATCH /api/v1/admin/bulk-operations/{id}

Edit a draft and invalidate its preview

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "additionalProperties": false,
          "properties": {
            "actions": {
              "items": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "period_count": {
                        "maximum": 3650,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "period_unit": {
                        "enum": [
                          "day",
                          "month",
                          "year"
                        ],
                        "type": "string"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "term_extend"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "period_unit",
                      "period_count"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "traffic_bytes": {
                        "pattern": "^[1-9][0-9]{0,17}$",
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "traffic_bonus"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "traffic_bytes"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "device_delta": {
                        "maximum": 10000,
                        "minimum": 1,
                        "type": "integer"
                      },
                      "expires_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "device_bonus"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "device_delta"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "code_id": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "issue_coupon"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "code_id"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "amount_minor": {
                        "pattern": "^[1-9][0-9]{0,17}$",
                        "type": "string"
                      },
                      "currency": {
                        "pattern": "^[A-Z]{3}$",
                        "type": "string"
                      },
                      "id": {
                        "pattern": "^[a-z][a-z0-9_]{0,31}$",
                        "type": "string"
                      },
                      "type": {
                        "enum": [
                          "gift_credit"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "amount_minor",
                      "currency"
                    ],
                    "type": "object"
                  }
                ]
              },
              "maxItems": 20,
              "type": "array"
            },
            "audience": {
              "oneOf": [
                {
                  "additionalProperties": false,
                  "properties": {
                    "emails": {
                      "default": [],
                      "items": {
                        "format": "email",
                        "type": "string"
                      },
                      "maxItems": 10000,
                      "type": "array"
                    },
                    "type": {
                      "enum": [
                        "list"
                      ],
                      "type": "string"
                    },
                    "user_ids": {
                      "default": [],
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "maxItems": 10000,
                      "type": "array"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "type": "object"
                },
                {
                  "additionalProperties": false,
                  "properties": {
                    "created_from": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "created_to": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "has_active_subscription": {
                      "type": "boolean"
                    },
                    "invited_by": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "locale": {
                      "maxLength": 35,
                      "type": "string"
                    },
                    "node_tags": {
                      "items": {
                        "maxLength": 64,
                        "type": "string"
                      },
                      "maxItems": 100,
                      "type": "array"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "maxItems": 100,
                      "type": "array"
                    },
                    "server_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "maxItems": 100,
                      "type": "array"
                    },
                    "status": {
                      "items": {
                        "enum": [
                          "active",
                          "disabled",
                          "banned",
                          "deactivating",
                          "deleted"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "subscription_ends_from": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "subscription_ends_to": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "subscription_status": {
                      "items": {
                        "enum": [
                          "scheduled",
                          "active",
                          "exhausted",
                          "expired",
                          "cancelled",
                          "refunded"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "type": {
                      "enum": [
                        "query"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "type"
                  ],
                  "type": "object"
                }
              ]
            },
            "kind": {
              "enum": [
                "compensation",
                "notification",
                "marketing"
              ],
              "type": "string"
            },
            "name": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            },
            "notification": {
              "additionalProperties": false,
              "properties": {
                "channels": {
                  "items": {
                    "enum": [
                      "email",
                      "inbox",
                      "telegram"
                    ],
                    "type": "string"
                  },
                  "maxItems": 3,
                  "minItems": 1,
                  "type": "array"
                },
                "template_key": {
                  "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                  "type": "string"
                },
                "values": {
                  "additionalProperties": {},
                  "default": {},
                  "type": "object"
                }
              },
              "required": [
                "template_key",
                "channels"
              ],
              "type": [
                "object",
                "null"
              ]
            }
          },
          "required": [
            "name",
            "kind",
            "audience",
            "actions",
            "notification"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "Edit a draft and invalidate its preview",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.update",
  "x-body": "json",
  "x-body-limit": 1048576,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "optional",
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/approve

POST /api/v1/admin/bulk-operations/{id}/approve

Approve the current preview as a second staff member

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "Approve the current preview as a second staff member",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.approve",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "required",
  "x-permission": "ops.bulk.execute",
  "x-reauth": true,
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/cancel

POST /api/v1/admin/bulk-operations/{id}/cancel

cancel a bulk operation with If-Match

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "cancel a bulk operation with If-Match",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.cancel",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "optional",
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/execute

POST /api/v1/admin/bulk-operations/{id}/execute

Execute the preview (If-Match, reauthentication and action permissions)

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "Execute the preview (If-Match, reauthentication and action permissions)",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.execute",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "required",
  "x-permission": "ops.bulk.manage",
  "x-reauth": true,
  "effectiveSecurity": []
}

GET /api/v1/admin/bulk-operations/{id}/failures.csv

GET /api/v1/admin/bulk-operations/{id}/failures.csv

Download all failed recipients

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "text/csv": {
          "schema": {
            "type": "string"
          }
        }
      },
      "description": "Failure CSV"
    }
  },
  "summary": "Download all failed recipients",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.export_failures",
  "x-body": "none",
  "x-body-limit": 0,
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/pause

POST /api/v1/admin/bulk-operations/{id}/pause

pause a bulk operation with If-Match

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "pause a bulk operation with If-Match",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.pause",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "optional",
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/preview

POST /api/v1/admin/bulk-operations/{id}/preview

Preview audience and effects

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "Preview audience and effects",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.preview",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "optional",
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

GET /api/v1/admin/bulk-operations/{id}/receipts

GET /api/v1/admin/bulk-operations/{id}/receipts

Read detailed per-user receipts and reversal eligibility (200 users per page)

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "in": "query",
      "name": "cursor",
      "required": false,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "items": {
                "items": {
                  "properties": {
                    "effects": {
                      "items": {
                        "properties": {
                          "action_id": {
                            "type": "string"
                          },
                          "device_delta": {
                            "type": "number"
                          },
                          "effect_id": {
                            "type": "string"
                          },
                          "gift_minor": {
                            "type": "string"
                          },
                          "reversible": {
                            "type": "boolean"
                          },
                          "status": {
                            "enum": [
                              "applied",
                              "pending",
                              "consumed",
                              "reversed"
                            ],
                            "type": "string"
                          },
                          "term_ms": {
                            "type": "string"
                          },
                          "traffic_bytes": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "action_id",
                          "effect_id",
                          "type",
                          "status",
                          "reversible",
                          "gift_minor",
                          "traffic_bytes",
                          "term_ms",
                          "device_delta"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "notifications": {
                      "items": {
                        "properties": {
                          "channel": {
                            "type": "string"
                          },
                          "reason": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "status": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "channel",
                          "status",
                          "reason"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "reversal": {
                      "properties": {
                        "effects": {
                          "items": {
                            "properties": {
                              "action_id": {
                                "type": "string"
                              },
                              "effect_id": {
                                "type": "string"
                              },
                              "reason": {
                                "type": [
                                  "string",
                                  "null"
                                ]
                              },
                              "status": {
                                "enum": [
                                  "reversed",
                                  "skipped",
                                  "failed"
                                ],
                                "type": "string"
                              },
                              "type": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "action_id",
                              "effect_id",
                              "type",
                              "status",
                              "reason"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "reason": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "status",
                        "reason",
                        "effects"
                      ],
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "status",
                    "reason",
                    "notifications",
                    "effects",
                    "reversal"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "next_cursor": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "items",
              "next_cursor"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation"
    }
  },
  "summary": "Read detailed per-user receipts and reversal eligibility (200 users per page)",
  "tags": [
    "bulk-operations"
  ],
  "x-body": "none",
  "x-body-limit": 0,
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

GET /api/v1/admin/bulk-operations/{id}/report

GET /api/v1/admin/bulk-operations/{id}/report

Audience, action counts and exact totals reconciled from effect records

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "applied_effects": {
                      "type": "number"
                    },
                    "consumed_effects": {
                      "type": "number"
                    },
                    "failed_users": {
                      "type": "number"
                    },
                    "id": {
                      "type": "string"
                    },
                    "pending_effects": {
                      "type": "number"
                    },
                    "reversed_effects": {
                      "type": "number"
                    },
                    "reversible_effects": {
                      "type": "number"
                    },
                    "skipped_users": {
                      "type": "number"
                    },
                    "succeeded_users": {
                      "type": "number"
                    },
                    "type": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "succeeded_users",
                    "failed_users",
                    "skipped_users",
                    "applied_effects",
                    "pending_effects",
                    "consumed_effects",
                    "reversed_effects",
                    "reversible_effects"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience_size": {
                "type": "number"
              },
              "channels": {
                "additionalProperties": {
                  "additionalProperties": {
                    "type": "number"
                  },
                  "type": "object"
                },
                "type": "object"
              },
              "counts": {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              "deliveries": {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              "generated_at": {
                "type": "string"
              },
              "operation": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "audience": {
                    "oneOf": [
                      {
                        "additionalProperties": false,
                        "properties": {
                          "emails": {
                            "default": [],
                            "items": {
                              "format": "email",
                              "type": "string"
                            },
                            "maxItems": 10000,
                            "type": "array"
                          },
                          "type": {
                            "enum": [
                              "list"
                            ],
                            "type": "string"
                          },
                          "user_ids": {
                            "default": [],
                            "items": {
                              "format": "uuid",
                              "type": "string"
                            },
                            "maxItems": 10000,
                            "type": "array"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "type": "object"
                      },
                      {
                        "additionalProperties": false,
                        "properties": {
                          "created_from": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "created_to": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "has_active_subscription": {
                            "type": "boolean"
                          },
                          "invited_by": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "locale": {
                            "maxLength": 35,
                            "type": "string"
                          },
                          "node_tags": {
                            "items": {
                              "maxLength": 64,
                              "type": "string"
                            },
                            "maxItems": 100,
                            "type": "array"
                          },
                          "plan_ids": {
                            "items": {
                              "format": "uuid",
                              "type": "string"
                            },
                            "maxItems": 100,
                            "type": "array"
                          },
                          "server_ids": {
                            "items": {
                              "format": "uuid",
                              "type": "string"
                            },
                            "maxItems": 100,
                            "type": "array"
                          },
                          "status": {
                            "items": {
                              "enum": [
                                "active",
                                "disabled",
                                "banned",
                                "deactivating",
                                "deleted"
                              ],
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "subscription_ends_from": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "subscription_ends_to": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "subscription_status": {
                            "items": {
                              "enum": [
                                "scheduled",
                                "active",
                                "exhausted",
                                "expired",
                                "cancelled",
                                "refunded"
                              ],
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "type": {
                            "enum": [
                              "query"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "type": "object"
                      }
                    ]
                  },
                  "created_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "done_count": {
                    "type": "number"
                  },
                  "executed_by": {
                    "format": "uuid",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "failed_count": {
                    "type": "number"
                  },
                  "failures": {
                    "items": {
                      "properties": {
                        "reason": {
                          "type": "string"
                        },
                        "user_id": {
                          "format": "uuid",
                          "type": "string"
                        }
                      },
                      "required": [
                        "user_id",
                        "reason"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "kind": {
                    "enum": [
                      "compensation",
                      "notification",
                      "marketing"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "notification": {
                    "additionalProperties": false,
                    "properties": {
                      "channels": {
                        "items": {
                          "enum": [
                            "email",
                            "inbox",
                            "telegram"
                          ],
                          "type": "string"
                        },
                        "maxItems": 3,
                        "minItems": 1,
                        "type": "array"
                      },
                      "template_key": {
                        "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                        "type": "string"
                      },
                      "values": {
                        "additionalProperties": {},
                        "default": {},
                        "type": "object"
                      }
                    },
                    "required": [
                      "template_key",
                      "channels"
                    ],
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "preview": {
                    "properties": {
                      "actions": {
                        "items": {
                          "properties": {
                            "amount_minor": {
                              "type": "string"
                            },
                            "code_id": {
                              "format": "uuid",
                              "type": "string"
                            },
                            "currency": {
                              "type": "string"
                            },
                            "device_delta": {
                              "type": "number"
                            },
                            "expires_at": {
                              "type": "string"
                            },
                            "id": {
                              "type": "string"
                            },
                            "period_count": {
                              "type": "number"
                            },
                            "period_unit": {
                              "enum": [
                                "day",
                                "month",
                                "year"
                              ],
                              "type": "string"
                            },
                            "plan_ids": {
                              "items": {
                                "format": "uuid",
                                "type": "string"
                              },
                              "type": "array"
                            },
                            "traffic_bytes": {
                              "type": "string"
                            },
                            "type": {
                              "enum": [
                                "term_extend",
                                "traffic_bonus",
                                "device_bonus",
                                "issue_coupon",
                                "gift_credit"
                              ],
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "type"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "approval_required": {
                        "type": "boolean"
                      },
                      "approved_at": {
                        "type": "string"
                      },
                      "approved_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "at": {
                        "type": "string"
                      },
                      "audience_hash": {
                        "type": "string"
                      },
                      "count": {
                        "type": "number"
                      },
                      "notification_missing_templates": {
                        "items": {
                          "properties": {
                            "channel": {
                              "type": "string"
                            },
                            "locale": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "channel",
                            "locale"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "sample": {
                        "items": {
                          "properties": {
                            "id": {
                              "format": "uuid",
                              "type": "string"
                            },
                            "public_id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id",
                            "public_id"
                          ],
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "count",
                      "sample",
                      "at",
                      "actions"
                    ],
                    "type": [
                      "object",
                      "null"
                    ]
                  },
                  "scheduled_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "skipped_count": {
                    "type": "number"
                  },
                  "status": {
                    "type": "string"
                  },
                  "target_count": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "version": {
                    "type": "integer"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "kind",
                  "scheduled_at",
                  "audience",
                  "actions",
                  "notification",
                  "status",
                  "version",
                  "preview",
                  "target_count",
                  "done_count",
                  "skipped_count",
                  "failed_count",
                  "failures",
                  "created_by",
                  "executed_by"
                ],
                "type": "object"
              },
              "receipt_count": {
                "type": "number"
              },
              "totals": {
                "properties": {
                  "issued": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "reversed": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "reversible": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "issued",
                  "reversed",
                  "reversible"
                ],
                "type": "object"
              },
              "users": {
                "properties": {
                  "failed": {
                    "type": "number"
                  },
                  "partially_reversed": {
                    "type": "number"
                  },
                  "pending": {
                    "type": "number"
                  },
                  "reversed": {
                    "type": "number"
                  },
                  "skipped": {
                    "type": "number"
                  },
                  "succeeded": {
                    "type": "number"
                  }
                },
                "required": [
                  "succeeded",
                  "failed",
                  "skipped",
                  "pending",
                  "reversed",
                  "partially_reversed"
                ],
                "type": "object"
              }
            },
            "required": [
              "operation",
              "counts",
              "deliveries",
              "channels",
              "audience_size",
              "receipt_count",
              "users",
              "actions",
              "totals",
              "generated_at"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation"
    }
  },
  "summary": "Audience, action counts and exact totals reconciled from effect records",
  "tags": [
    "bulk-operations"
  ],
  "x-body": "none",
  "x-body-limit": 0,
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/resume

POST /api/v1/admin/bulk-operations/{id}/resume

resume a bulk operation with If-Match

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "resume a bulk operation with If-Match",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.resume",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "optional",
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

GET /api/v1/admin/bulk-operations/{id}/reversal

GET /api/v1/admin/bulk-operations/{id}/reversal

Read persisted reversal preview and per-user progress

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "reversal": {
                "properties": {
                  "counts": {
                    "additionalProperties": {
                      "type": "number"
                    },
                    "type": "object"
                  },
                  "executed_by": {
                    "format": "uuid",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "finished_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "operation_id": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "preview": {
                    "properties": {
                      "already_reversed": {
                        "type": "integer"
                      },
                      "at": {
                        "type": "string"
                      },
                      "batch_version": {
                        "type": "integer"
                      },
                      "effects": {
                        "type": "integer"
                      },
                      "eligible": {
                        "type": "integer"
                      },
                      "expires_at": {
                        "type": "string"
                      },
                      "fingerprint": {
                        "type": "string"
                      },
                      "gift_minor": {
                        "type": "string"
                      },
                      "retained": {
                        "type": "integer"
                      },
                      "term_ms": {
                        "type": "string"
                      },
                      "traffic_bytes": {
                        "type": "string"
                      },
                      "users": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "batch_version",
                      "fingerprint",
                      "at",
                      "expires_at",
                      "users",
                      "effects",
                      "eligible",
                      "retained",
                      "already_reversed",
                      "gift_minor",
                      "traffic_bytes",
                      "term_ms"
                    ],
                    "type": "object"
                  },
                  "recoverable": {
                    "type": "boolean"
                  },
                  "requested_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "started_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "status": {
                    "enum": [
                      "previewed",
                      "running",
                      "completed",
                      "failed"
                    ],
                    "type": "string"
                  },
                  "version": {
                    "type": "integer"
                  }
                },
                "required": [
                  "operation_id",
                  "status",
                  "version",
                  "requested_by",
                  "executed_by",
                  "started_at",
                  "finished_at",
                  "counts",
                  "recoverable",
                  "preview"
                ],
                "type": [
                  "object",
                  "null"
                ]
              }
            },
            "required": [
              "reversal"
            ],
            "type": "object"
          }
        }
      },
      "description": "Reversal, or null before preview"
    },
    "401": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Authentication required"
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Permission required"
    },
    "404": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "No such batch"
    },
    "422": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Invalid batch identifier"
    }
  },
  "summary": "Read persisted reversal preview and per-user progress",
  "tags": [
    "bulk-operations"
  ],
  "x-body": "none",
  "x-body-limit": 0,
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/reversal/execute

POST /api/v1/admin/bulk-operations/{id}/reversal/execute

Execute or resume the previewed reversal with reauthentication and every business permission

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "counts": {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "finished_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "operation_id": {
                "format": "uuid",
                "type": "string"
              },
              "preview": {
                "properties": {
                  "already_reversed": {
                    "type": "integer"
                  },
                  "at": {
                    "type": "string"
                  },
                  "batch_version": {
                    "type": "integer"
                  },
                  "effects": {
                    "type": "integer"
                  },
                  "eligible": {
                    "type": "integer"
                  },
                  "expires_at": {
                    "type": "string"
                  },
                  "fingerprint": {
                    "type": "string"
                  },
                  "gift_minor": {
                    "type": "string"
                  },
                  "retained": {
                    "type": "integer"
                  },
                  "term_ms": {
                    "type": "string"
                  },
                  "traffic_bytes": {
                    "type": "string"
                  },
                  "users": {
                    "type": "integer"
                  }
                },
                "required": [
                  "batch_version",
                  "fingerprint",
                  "at",
                  "expires_at",
                  "users",
                  "effects",
                  "eligible",
                  "retained",
                  "already_reversed",
                  "gift_minor",
                  "traffic_bytes",
                  "term_ms"
                ],
                "type": "object"
              },
              "recoverable": {
                "type": "boolean"
              },
              "requested_by": {
                "format": "uuid",
                "type": "string"
              },
              "started_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "enum": [
                  "previewed",
                  "running",
                  "completed",
                  "failed"
                ],
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "operation_id",
              "status",
              "version",
              "requested_by",
              "executed_by",
              "started_at",
              "finished_at",
              "counts",
              "recoverable",
              "preview"
            ],
            "type": "object"
          }
        }
      },
      "description": "Durable batch reversal",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "401": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Authentication required"
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Permission or reauthentication required"
    },
    "404": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "No such batch"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Preview expired, changed or invalid state"
    },
    "412": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Malformed If-Match"
    },
    "422": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Invalid batch identifier"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "If-Match required"
    }
  },
  "summary": "Execute or resume the previewed reversal with reauthentication and every business permission",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.reverse_execute",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "required",
  "x-permission": "ops.bulk.manage",
  "x-reauth": true,
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/reversal/preview

POST /api/v1/admin/bulk-operations/{id}/reversal/preview

Preview reversal of the remaining successful receipts (ten-minute validity)

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "counts": {
                "additionalProperties": {
                  "type": "number"
                },
                "type": "object"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "finished_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "operation_id": {
                "format": "uuid",
                "type": "string"
              },
              "preview": {
                "properties": {
                  "already_reversed": {
                    "type": "integer"
                  },
                  "at": {
                    "type": "string"
                  },
                  "batch_version": {
                    "type": "integer"
                  },
                  "effects": {
                    "type": "integer"
                  },
                  "eligible": {
                    "type": "integer"
                  },
                  "expires_at": {
                    "type": "string"
                  },
                  "fingerprint": {
                    "type": "string"
                  },
                  "gift_minor": {
                    "type": "string"
                  },
                  "retained": {
                    "type": "integer"
                  },
                  "term_ms": {
                    "type": "string"
                  },
                  "traffic_bytes": {
                    "type": "string"
                  },
                  "users": {
                    "type": "integer"
                  }
                },
                "required": [
                  "batch_version",
                  "fingerprint",
                  "at",
                  "expires_at",
                  "users",
                  "effects",
                  "eligible",
                  "retained",
                  "already_reversed",
                  "gift_minor",
                  "traffic_bytes",
                  "term_ms"
                ],
                "type": "object"
              },
              "recoverable": {
                "type": "boolean"
              },
              "requested_by": {
                "format": "uuid",
                "type": "string"
              },
              "started_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "enum": [
                  "previewed",
                  "running",
                  "completed",
                  "failed"
                ],
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "operation_id",
              "status",
              "version",
              "requested_by",
              "executed_by",
              "started_at",
              "finished_at",
              "counts",
              "recoverable",
              "preview"
            ],
            "type": "object"
          }
        }
      },
      "description": "Durable batch reversal",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "401": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Authentication required"
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Permission or reauthentication required"
    },
    "404": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "No such batch"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Preview expired, changed or invalid state"
    },
    "412": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Malformed If-Match"
    },
    "422": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "Invalid batch identifier"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "$ref": "#/components/schemas/Problem"
          }
        }
      },
      "description": "If-Match required"
    }
  },
  "summary": "Preview reversal of the remaining successful receipts (ten-minute validity)",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.reverse_preview",
  "x-body": "none",
  "x-body-limit": 0,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "optional",
  "x-permission": "ops.bulk.manage",
  "effectiveSecurity": []
}

POST /api/v1/admin/bulk-operations/{id}/schedule

POST /api/v1/admin/bulk-operations/{id}/schedule

Schedule a frozen, approved audience

{
  "parameters": [
    {
      "in": "path",
      "name": "id",
      "required": true,
      "schema": {
        "format": "uuid",
        "type": "string"
      }
    },
    {
      "description": "Resource ETag; missing 428, malformed 412, stale 409.",
      "in": "header",
      "name": "If-Match",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "additionalProperties": false,
          "properties": {
            "scheduled_at": {
              "format": "date-time",
              "type": "string"
            }
          },
          "required": [
            "scheduled_at"
          ],
          "type": "object"
        }
      }
    },
    "required": true
  },
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "properties": {
              "actions": {
                "items": {
                  "properties": {
                    "amount_minor": {
                      "type": "string"
                    },
                    "code_id": {
                      "format": "uuid",
                      "type": "string"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "device_delta": {
                      "type": "number"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "period_count": {
                      "type": "number"
                    },
                    "period_unit": {
                      "enum": [
                        "day",
                        "month",
                        "year"
                      ],
                      "type": "string"
                    },
                    "plan_ids": {
                      "items": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "traffic_bytes": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "term_extend",
                        "traffic_bonus",
                        "device_bonus",
                        "issue_coupon",
                        "gift_credit"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "type"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "audience": {
                "oneOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "emails": {
                        "default": [],
                        "items": {
                          "format": "email",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "list"
                        ],
                        "type": "string"
                      },
                      "user_ids": {
                        "default": [],
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 10000,
                        "type": "array"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  },
                  {
                    "additionalProperties": false,
                    "properties": {
                      "created_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "has_active_subscription": {
                        "type": "boolean"
                      },
                      "invited_by": {
                        "format": "uuid",
                        "type": "string"
                      },
                      "locale": {
                        "maxLength": 35,
                        "type": "string"
                      },
                      "node_tags": {
                        "items": {
                          "maxLength": 64,
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "plan_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "server_ids": {
                        "items": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "maxItems": 100,
                        "type": "array"
                      },
                      "status": {
                        "items": {
                          "enum": [
                            "active",
                            "disabled",
                            "banned",
                            "deactivating",
                            "deleted"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "subscription_ends_from": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_ends_to": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "subscription_status": {
                        "items": {
                          "enum": [
                            "scheduled",
                            "active",
                            "exhausted",
                            "expired",
                            "cancelled",
                            "refunded"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "query"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "type"
                    ],
                    "type": "object"
                  }
                ]
              },
              "created_by": {
                "format": "uuid",
                "type": "string"
              },
              "done_count": {
                "type": "number"
              },
              "executed_by": {
                "format": "uuid",
                "type": [
                  "string",
                  "null"
                ]
              },
              "failed_count": {
                "type": "number"
              },
              "failures": {
                "items": {
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "user_id": {
                      "format": "uuid",
                      "type": "string"
                    }
                  },
                  "required": [
                    "user_id",
                    "reason"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "format": "uuid",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "compensation",
                  "notification",
                  "marketing"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "notification": {
                "additionalProperties": false,
                "properties": {
                  "channels": {
                    "items": {
                      "enum": [
                        "email",
                        "inbox",
                        "telegram"
                      ],
                      "type": "string"
                    },
                    "maxItems": 3,
                    "minItems": 1,
                    "type": "array"
                  },
                  "template_key": {
                    "pattern": "^[a-z][a-z0-9_.]{1,100}$",
                    "type": "string"
                  },
                  "values": {
                    "additionalProperties": {},
                    "default": {},
                    "type": "object"
                  }
                },
                "required": [
                  "template_key",
                  "channels"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "preview": {
                "properties": {
                  "actions": {
                    "items": {
                      "properties": {
                        "amount_minor": {
                          "type": "string"
                        },
                        "code_id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "currency": {
                          "type": "string"
                        },
                        "device_delta": {
                          "type": "number"
                        },
                        "expires_at": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "period_count": {
                          "type": "number"
                        },
                        "period_unit": {
                          "enum": [
                            "day",
                            "month",
                            "year"
                          ],
                          "type": "string"
                        },
                        "plan_ids": {
                          "items": {
                            "format": "uuid",
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "traffic_bytes": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "term_extend",
                            "traffic_bonus",
                            "device_bonus",
                            "issue_coupon",
                            "gift_credit"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "type"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "approval_required": {
                    "type": "boolean"
                  },
                  "approved_at": {
                    "type": "string"
                  },
                  "approved_by": {
                    "format": "uuid",
                    "type": "string"
                  },
                  "at": {
                    "type": "string"
                  },
                  "audience_hash": {
                    "type": "string"
                  },
                  "count": {
                    "type": "number"
                  },
                  "notification_missing_templates": {
                    "items": {
                      "properties": {
                        "channel": {
                          "type": "string"
                        },
                        "locale": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "channel",
                        "locale"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "sample": {
                    "items": {
                      "properties": {
                        "id": {
                          "format": "uuid",
                          "type": "string"
                        },
                        "public_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "public_id"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "count",
                  "sample",
                  "at",
                  "actions"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "scheduled_at": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "skipped_count": {
                "type": "number"
              },
              "status": {
                "type": "string"
              },
              "target_count": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "version": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "name",
              "kind",
              "scheduled_at",
              "audience",
              "actions",
              "notification",
              "status",
              "version",
              "preview",
              "target_count",
              "done_count",
              "skipped_count",
              "failed_count",
              "failures",
              "created_by",
              "executed_by"
            ],
            "type": "object"
          }
        }
      },
      "description": "Bulk operation",
      "headers": {
        "ETag": {
          "description": "Current resource version for If-Match.",
          "schema": {
            "type": "string"
          }
        }
      }
    },
    "403": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "409": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    },
    "428": {
      "content": {
        "application/problem+json": {
          "schema": {
            "properties": {
              "code": {
                "type": "string"
              },
              "request_id": {
                "type": "string"
              },
              "status": {
                "type": "number"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "status",
              "title",
              "type",
              "request_id"
            ],
            "type": "object"
          }
        }
      },
      "description": "Command refused"
    }
  },
  "summary": "Schedule a frozen, approved audience",
  "tags": [
    "bulk-operations"
  ],
  "x-audit": "ops.bulk.schedule",
  "x-body": "json",
  "x-body-limit": 1048576,
  "x-concurrency": {
    "etag": true,
    "ifMatch": true
  },
  "x-idempotency": "required",
  "x-permission": "ops.bulk.manage",
  "x-reauth": true,
  "effectiveSecurity": []
}