{
  "openapi": "3.0.1",
  "info": {
    "title": "Doom Public API",
    "version": "v1"
  },
  "paths": {
    "/v1/account/balance": {
      "get": {
        "tags": [
          "Account"
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": [ ]
          },
          {
            "ApiKeyHeader": [ ]
          }
        ]
      }
    },
    "/v1/campaigns": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LaunchCampaignRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/LaunchCampaignRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/LaunchCampaignRequest"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "charge_uncertain: the charge outcome is unknown, or the campaign was not created and the charge could not be refunded. Do not retry; check GET /v1/campaigns and the balance, and contact support. internal_error: unexpected error.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "service_unavailable: nothing was charged or the charge was refunded. Retry after the Retry-After seconds.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/LaunchCampaignResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaunchCampaignResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaunchCampaignResponse"
                }
              }
            }
          },
          "409": {
            "description": "idempotency_key_reused: the Idempotency-Key was already used for a different launch request (type, target, tariff, quantity or durationMinutes differ). Use a new key for a new campaign.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": [ ]
          },
          {
            "ApiKeyHeader": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 0
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": [ ]
          },
          {
            "ApiKeyHeader": [ ]
          }
        ]
      }
    },
    "/v1/campaigns/{id}": {
      "get": {
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CampaignDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": [ ]
          },
          {
            "ApiKeyHeader": [ ]
          }
        ]
      }
    },
    "/v1/campaigns/{id}/cancel": {
      "post": {
        "tags": [
          "Campaigns"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CancelCampaignResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelCampaignResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelCampaignResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": [ ]
          },
          {
            "ApiKeyHeader": [ ]
          }
        ]
      }
    },
    "/v1/keys": {
      "get": {
        "tags": [
          "Keys"
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KeyDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KeyDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KeyDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "JwtBearer": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Keys"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKeyRequest"
              }
            }
          }
        },
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "internal_error: if the key creation outcome is unknown, list keys with GET /v1/keys before retrying.",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedKeyDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedKeyDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedKeyDto"
                }
              }
            }
          },
          "413": {
            "description": "Content Too Large",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "JwtBearer": [ ]
          }
        ]
      }
    },
    "/v1/keys/{id}/revoke": {
      "post": {
        "tags": [
          "Keys"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeKeyResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeKeyResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeKeyResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "JwtBearer": [ ]
          }
        ]
      }
    },
    "/v1/tariffs": {
      "get": {
        "tags": [
          "Pricing"
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TariffsResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TariffsResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TariffsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": [ ]
          },
          {
            "ApiKeyHeader": [ ]
          }
        ]
      }
    },
    "/v1/price": {
      "get": {
        "tags": [
          "Pricing"
        ],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Campaign channel to price: 'email' (default) or 'phone'. For 'phone' send quantity and durationMinutes and no tariff.",
            "schema": {
              "enum": [
                "email",
                "phone"
              ],
              "type": "string",
              "default": "email"
            }
          },
          {
            "name": "tariff",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "durationMinutes",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicErrorEnvelope"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyBearer": [ ]
          },
          {
            "ApiKeyHeader": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "BalanceResponse": {
        "required": [
          "balance",
          "currency"
        ],
        "type": "object",
        "properties": {
          "balance": {
            "type": "number",
            "format": "double"
          },
          "currency": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CampaignDto": {
        "required": [
          "cost",
          "createdAt",
          "durationMinutes",
          "id",
          "progressPercent",
          "status",
          "target",
          "tariff",
          "type"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "enum": [
              "email",
              "phone"
            ],
            "type": "string"
          },
          "target": {
            "type": "string"
          },
          "status": {
            "enum": [
              "running",
              "completed",
              "scheduled",
              "failed",
              "cancelled",
              "timeout",
              "starting"
            ],
            "type": "string"
          },
          "tariff": {
            "enum": [
              "default",
              "fast",
              "long",
              "other"
            ],
            "type": "string"
          },
          "requestedMessages": {
            "type": "integer",
            "description": "For long and phone campaigns, the quantity requested at launch without bonus messages. Preset tariffs (default, fast) report a nominal 1000. Long campaigns created before the bonus fix may include the 100-message bonus. Null when not applicable.",
            "format": "int32",
            "nullable": true
          },
          "progressPercent": {
            "type": "integer",
            "format": "int32"
          },
          "cost": {
            "type": "number",
            "format": "double"
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CampaignListResponse": {
        "required": [
          "items",
          "limit",
          "offset",
          "total",
          "totalIsCapped"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CampaignDto"
            }
          },
          "total": {
            "type": "integer",
            "description": "Number of campaigns matching the filter, counted up to 10000. When totalIsCapped is true the real number is larger.",
            "format": "int32"
          },
          "limit": {
            "type": "integer",
            "format": "int32"
          },
          "offset": {
            "type": "integer",
            "format": "int32"
          },
          "totalIsCapped": {
            "type": "boolean",
            "description": "True when more than 10000 campaigns match and total is capped at 10000."
          }
        },
        "additionalProperties": false
      },
      "CancelCampaignResponse": {
        "required": [
          "id",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "running",
              "completed",
              "scheduled",
              "failed",
              "cancelled",
              "timeout",
              "starting"
            ],
            "type": "string",
            "description": "Status after cancellation. A campaign cancelled through this API ends as 'completed'. 'cancelled' can appear for a cancellation made by the system."
          }
        },
        "additionalProperties": false
      },
      "CreateKeyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreatedKeyDto": {
        "required": [
          "createdAt",
          "id",
          "key",
          "prefix"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "KeyDto": {
        "required": [
          "createdAt",
          "id",
          "phoneAllowed",
          "prefix"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "prefix": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "phoneAllowed": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "revokedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LaunchCampaignRequest": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "Campaign channel: 'email' or 'phone' (case-insensitive).",
            "nullable": true
          },
          "target": {
            "type": "string",
            "description": "For type 'email' an email address. For type 'phone' a US number in strict E.164 form +1XXXXXXXXXX (surrounding spaces are trimmed; other formatting is rejected).",
            "nullable": true
          },
          "tariff": {
            "type": "string",
            "description": "Email only: 'default', 'fast' or 'long'. Must not be sent for type 'phone'.",
            "nullable": true
          },
          "quantity": {
            "type": "integer",
            "description": "Email tariff 'long': number of messages. Phone: required number of SMS, within the limits from GET /v1/tariffs (phone).",
            "format": "int32",
            "nullable": true
          },
          "durationMinutes": {
            "type": "integer",
            "description": "Email tariff 'long': optional duration in minutes. Phone: required duration in minutes, between phone.minDurationMinutes (30) and phone.maxDurationMinutes from GET /v1/tariffs.",
            "format": "int32",
            "nullable": true
          },
          "startTime": {
            "type": "string",
            "description": "ISO-8601 date-time such as 2026-10-14T12:00:00Z or 2026-10-14T15:00+03:00; seconds and fraction are optional. A value without an explicit UTC offset is interpreted as UTC. A date without time is rejected. Not more than 5 minutes in the past and not more than 7 days in the future.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "LaunchCampaignResponse": {
        "required": [
          "chargedAmount",
          "id",
          "newBalance",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "running",
              "completed",
              "scheduled",
              "failed",
              "cancelled",
              "timeout",
              "starting"
            ],
            "type": "string"
          },
          "chargedAmount": {
            "type": "number",
            "format": "double"
          },
          "newBalance": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "LongTariffDto": {
        "required": [
          "basePricePer100",
          "bonusMessages",
          "bonusMessagesOverMinutes",
          "finalPricePer100",
          "maxDurationMinutes",
          "maxQuantity",
          "minQuantity"
        ],
        "type": "object",
        "properties": {
          "minQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "maxQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "maxDurationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "basePricePer100": {
            "type": "number",
            "format": "double"
          },
          "finalPricePer100": {
            "type": "number",
            "format": "double"
          },
          "bonusMessagesOverMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "bonusMessages": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Long tariff bonus rule: when durationMinutes is greater than bonusMessagesOverMinutes, bonusMessages extra messages are added to the requested quantity and billed. The price from GET /v1/price and the charge include them; requestedMessages of the campaign stays the quantity you asked for."
      },
      "PhoneTariffDto": {
        "required": [
          "maxDurationMinutes",
          "maxQuantity",
          "minDurationMinutes",
          "minQuantity",
          "pricePer100"
        ],
        "type": "object",
        "properties": {
          "minQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "maxQuantity": {
            "type": "integer",
            "format": "int32"
          },
          "minDurationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "maxDurationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "pricePer100": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "PriceResponse": {
        "required": [
          "basePrice",
          "discountRate",
          "finalPrice"
        ],
        "type": "object",
        "properties": {
          "basePrice": {
            "type": "number",
            "format": "double"
          },
          "finalPrice": {
            "type": "number",
            "format": "double"
          },
          "discountRate": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "PublicErrorBody": {
        "required": [
          "code",
          "message",
          "requestId"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "PublicErrorEnvelope": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/PublicErrorBody"
          }
        },
        "additionalProperties": false
      },
      "RevokeKeyResponse": {
        "required": [
          "id",
          "revoked"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "revoked": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TariffDto": {
        "required": [
          "basePrice",
          "discountRate",
          "durationMinutes",
          "finalPrice",
          "quantity",
          "tariff"
        ],
        "type": "object",
        "properties": {
          "tariff": {
            "enum": [
              "default",
              "fast",
              "long"
            ],
            "type": "string"
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          },
          "quantity": {
            "type": "integer",
            "format": "int32"
          },
          "basePrice": {
            "type": "number",
            "format": "double"
          },
          "finalPrice": {
            "type": "number",
            "format": "double"
          },
          "discountRate": {
            "type": "number",
            "format": "double"
          }
        },
        "additionalProperties": false
      },
      "TariffsResponse": {
        "required": [
          "long",
          "phone",
          "tariffs"
        ],
        "type": "object",
        "properties": {
          "tariffs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TariffDto"
            }
          },
          "long": {
            "$ref": "#/components/schemas/LongTariffDto"
          },
          "phone": {
            "$ref": "#/components/schemas/PhoneTariffDto"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "ApiKeyBearer": {
        "type": "http",
        "description": "API key sent as a bearer token.",
        "scheme": "bearer",
        "bearerFormat": "doom_api_..."
      },
      "ApiKeyHeader": {
        "type": "apiKey",
        "description": "API key sent in the X-Api-Key header.",
        "name": "X-Api-Key",
        "in": "header"
      },
      "JwtBearer": {
        "type": "http",
        "description": "Site session JWT, used only for API key management.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}