{
  "openapi": "3.0.1",
  "info": {
    "title": "Pryanick Web API",
    "version": "v1"
  },
  "paths": {
    "/api/json/v1/sessions/{id}": {
      "get": {
        "tags": [
          "Account"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/accounts": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getAccounts",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/accounts/{id}": {
      "get": {
        "tags": [
          "Account"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Account"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/login": {
      "get": {
        "tags": [
          "Account"
        ],
        "parameters": [
          {
            "name": "Login",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Password",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Mac",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Device",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "App",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/categories": {
      "get": {
        "tags": [
          "Category"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/categories/{categoryId}/channels": {
      "get": {
        "tags": [
          "Category"
        ],
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "categoryId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/getFavorites": {
      "get": {
        "tags": [
          "Channel"
        ],
        "parameters": [
          {
            "name": "Token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/channels/{channelId}/favorite": {
      "get": {
        "tags": [
          "Channel"
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/getTopChannels": {
      "get": {
        "tags": [
          "Channel"
        ],
        "parameters": [
          {
            "name": "Token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/channels": {
      "post": {
        "tags": [
          "Channel"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelInputDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelInputDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ChannelInputDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "tags": [
          "Channel"
        ],
        "operationId": "getChannelsByToken",
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "timestamp",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/channels/crm": {
      "get": {
        "tags": [
          "Channel"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/channels/{id}": {
      "delete": {
        "tags": [
          "Channel"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/channels/{id}/epg": {
      "get": {
        "tags": [
          "Channel"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "From",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "To",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "IsNewVersion",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/channels/{id}/url": {
      "get": {
        "tags": [
          "Channel"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "gmt",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "isUpdatable",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/channel_sessions/check": {
      "get": {
        "tags": [
          "ChannelSession"
        ],
        "parameters": [
          {
            "name": "Name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Proto",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Ip",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "RequestType",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "RequestNumber",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "SessionId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Duration",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Bytes",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Qs",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Dvr",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "UserAgent",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Referer",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Host",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/colocations": {
      "post": {
        "tags": [
          "Colocation"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Colocation"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Colocation"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Colocation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "tags": [
          "Colocation"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/colocations/{id}": {
      "patch": {
        "tags": [
          "Colocation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Colocation"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Colocation"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Colocation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Colocation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "get": {
        "tags": [
          "Colocation"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/accounts": {
      "get": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "isEnabled",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "serverId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "perPage",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/accounts/{id}": {
      "get": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "patch": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmAccountUpdateDto"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmAccountUpdateDto"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CrmAccountUpdateDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/accounts/{id}/sessions": {
      "get": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/accounts/{id}/sessions/{sessionId}": {
      "delete": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/accounts/{id}/channel-sessions": {
      "get": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "activeOnly",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/accounts/{id}/channel-sessions/{sessionId}/deactivate": {
      "post": {
        "tags": [
          "CrmAccount"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/packages": {
      "get": {
        "tags": [
          "CrmAccount"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/crm/servers": {
      "get": {
        "tags": [
          "CrmAccount"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/epgs/xml": {
      "get": {
        "tags": [
          "Epg"
        ],
        "operationId": "downloadXmlEpg",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/epgs/cache": {
      "get": {
        "tags": [
          "Epg"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/export/accounts": {
      "get": {
        "tags": [
          "Export"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/favorites/update": {
      "post": {
        "tags": [
          "Favorite"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFavorites"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFavorites"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFavorites"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/sessions/{id}": {
      "get": {
        "tags": [
          "Session"
        ],
        "operationId": "GetSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/update": {
      "get": {
        "tags": [
          "Update"
        ],
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vCode",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/json/v1/app/update": {
      "get": {
        "tags": [
          "Update"
        ],
        "parameters": [
          {
            "name": "app",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vCode",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "token",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vods": {
      "get": {
        "tags": [
          "Vod"
        ],
        "operationId": "getVods",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vods/{id}/content": {
      "get": {
        "tags": [
          "Vod"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Type",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "VodId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Year",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Actors",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Countries",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Genres",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "AgeRating",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Rating",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Description",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "PerPage",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "SortOrder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "OrderBy",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/content/{id}/media": {
      "get": {
        "tags": [
          "Vod"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/media/{id}/url": {
      "get": {
        "tags": [
          "Vod"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/vods/content/{id}": {
      "get": {
        "tags": [
          "Vod"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ChannelInputDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "imageUrl": {
            "type": "string",
            "nullable": true
          },
          "isEnabled": {
            "type": "boolean"
          },
          "epgId": {
            "type": "string",
            "nullable": true
          },
          "stream": {
            "type": "string",
            "nullable": true
          },
          "epgProvider": {
            "type": "string",
            "nullable": true
          },
          "archiveDepth": {
            "type": "integer",
            "format": "int32"
          },
          "packages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DtoInnerParameter"
            },
            "nullable": true
          },
          "categories": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DtoInnerParameter"
            },
            "nullable": true
          },
          "colocation": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DtoInnerParameter"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Colocation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "isEnabled": {
            "type": "boolean"
          },
          "domain": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CrmAccountUpdateDto": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "nullable": true
          },
          "parentCode": {
            "type": "string",
            "nullable": true
          },
          "isEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "parentMode": {
            "type": "boolean",
            "nullable": true
          },
          "isDev": {
            "type": "boolean",
            "nullable": true
          },
          "duration": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "ipLimit": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "maxDevices": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "timeShift": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "serverId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "resetActivation": {
            "type": "boolean"
          },
          "packageIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DtoInnerParameter": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UpdateFavorites": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "nullable": true
          },
          "favorite": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "JWT Authorization Header using the bearer token",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ]
}