{
  "openapi": "3.0.1",
  "info": {
    "title": "Votexh Admin API",
    "description": "API for managing SMS Admin functionality",
    "version": "v1"
  },
  "paths": {
    "/api/DID/DeleteDID": {
      "delete": {
        "tags": [
          "DID"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DIDDeletionRequestDTO"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/DIDDeletionRequestDTO"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/DIDDeletionRequestDTO"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsResponseDataWrapper"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsResponseDataWrapper"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsResponseDataWrapper"
                }
              }
            }
          }
        }
      }
    },
    "/api/SendMessage/send": {
      "post": {
        "tags": [
          "SendMessage"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SmsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/SmsResponseDataWrapper"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsResponseDataWrapper"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsResponseDataWrapper"
                }
              }
            }
          }
        }
      }
    },
    "/api/SendMessage/MessageListing": {
      "get": {
        "tags": [
          "SendMessage"
        ],
        "parameters": [
          {
            "name": "fromDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "toDate",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "number",
            "in": "query",
            "schema": {
              "type": "string",
              "default": ""
            }
          },
          {
            "name": "pageNumber",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 10
            }
          },
          {
            "name": "SortDirection",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "ASC"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientMessageSummaryDataDataWrapper"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientMessageSummaryDataDataWrapper"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientMessageSummaryDataDataWrapper"
                }
              }
            }
          }
        }
      }
    },
    "/api/SendMessage/GetBalance": {
      "get": {
        "tags": [
          "SendMessage"
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClientBalanceDataWrapper"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientBalanceDataWrapper"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientBalanceDataWrapper"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ClientBalance": {
        "type": "object",
        "properties": {
          "clientName": {
            "type": "string",
            "nullable": true
          },
          "currentBalance": {
            "type": "number",
            "format": "double"
          },
          "lastCreditAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "lastCreditAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ClientBalanceDataWrapper": {
        "type": "object",
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ClientBalance"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "stackTrace": {
            "type": "string",
            "nullable": true
          },
          "statusCode": {
            "$ref": "#/components/schemas/ResponseCodes"
          },
          "timeTaken": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ClientMessageSummaryData": {
        "type": "object",
        "properties": {
          "totalMessages": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          },
          "pendingCount": {
            "type": "integer",
            "format": "int32"
          },
          "sentCount": {
            "type": "integer",
            "format": "int32"
          },
          "deliveredCount": {
            "type": "integer",
            "format": "int32"
          },
          "failedCount": {
            "type": "integer",
            "format": "int32"
          },
          "receivedCount": {
            "type": "integer",
            "format": "int32"
          },
          "messageListingDtos": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageListingDataDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ClientMessageSummaryDataDataWrapper": {
        "type": "object",
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/ClientMessageSummaryData"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "stackTrace": {
            "type": "string",
            "nullable": true
          },
          "statusCode": {
            "$ref": "#/components/schemas/ResponseCodes"
          },
          "timeTaken": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "DIDDeletionRequestDTO": {
        "type": "object",
        "properties": {
          "did": {
            "type": "string",
            "nullable": true
          },
          "userName": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MessageListingDataDto": {
        "type": "object",
        "properties": {
          "messageId": {
            "type": "integer",
            "format": "int64"
          },
          "customerCountry": {
            "type": "string",
            "nullable": true
          },
          "customerNumber": {
            "type": "string",
            "nullable": true
          },
          "clientCountry": {
            "type": "string",
            "nullable": true
          },
          "didNumber": {
            "type": "string",
            "nullable": true
          },
          "messageStatus": {
            "type": "string",
            "nullable": true
          },
          "messageDate": {
            "type": "string",
            "format": "date-time"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "mediaUrl": {
            "type": "string",
            "nullable": true
          },
          "rowNum": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "ResponseCodes": {
        "enum": [
          200,
          400,
          401,
          403,
          404,
          409,
          422,
          500
        ],
        "type": "integer",
        "format": "int32"
      },
      "SmsRequest": {
        "required": [
          "from",
          "to"
        ],
        "type": "object",
        "properties": {
          "from": {
            "minLength": 1,
            "pattern": "^\\+?[1-9]\\d{1,14}$",
            "type": "string"
          },
          "to": {
            "minLength": 1,
            "pattern": "^\\+?[1-9]\\d{1,14}$",
            "type": "string"
          },
          "text": {
            "type": "string",
            "nullable": true
          },
          "media_urls": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SmsResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "messageStatus": {
            "type": "string",
            "nullable": true
          },
          "messageIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SmsResponseDataWrapper": {
        "type": "object",
        "properties": {
          "isSuccess": {
            "type": "boolean"
          },
          "data": {
            "$ref": "#/components/schemas/SmsResponse"
          },
          "errorMessage": {
            "type": "string",
            "nullable": true
          },
          "stackTrace": {
            "type": "string",
            "nullable": true
          },
          "statusCode": {
            "$ref": "#/components/schemas/ResponseCodes"
          },
          "timeTaken": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "JWT Authorization header using the Bearer scheme. Example: \"Authorization: Bearer {token}\"",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}