{
  "openapi": "3.0.1",
  "info": {
    "title": "domain",
    "description": "API предназначен для обеспечения взаимодействия партнеров с HB.BY.",
    "termsOfService": "https://hb.by/agreements",
    "contact": {
      "name": "HB.BY",
      "url": "https://hb.by",
      "email": "support@hb.by"
    },
    "version": "1.0"
  },
  "paths": {
    "/v1/domains/check": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Получить доступность одного или нескольких доменов",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/check\r\n{\r\n  \"domains\": [\r\n    \"hb.by\"\r\n  ]\r\n}\r\n```\r\n            \r\nПример ответа:\r\n            \r\n```\r\n{\r\n  \"results\": [\r\n    {\r\n      \"domain\": \"hb.by\",\r\n      \"is_available\": false,\r\n      \"is_premium\": false,\r\n      \"state\": \"NotAvailable\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>results</strong> — список объектов с результатами проверки доменов.\r\n</li>\r\n<li><strong>domain</strong> — домен, который проверяли.\r\n</li>\r\n<li><strong>is_available</strong> — доступен ли домен для регистрации (true/false).\r\n</li>\r\n<li><strong>is_premium</strong> — является ли домен премиальным (true/false).\r\n</li>\r\n<li><strong>state</strong> — строка, указывающая текущий статус домена в реестре.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostCheckResultRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/PostCheckResultResponseDto"
							}
						}
					}
				}
			}
		}
    },
    "/v1/domains/{orderId}/certificate": {
		"get": {
			"tags": [
				"DomainApi"
			],
			"summary": "Получить сертификат владения доменом",
			"description": "Пример запроса:\r\n            \r\n```\r\n// GET https://api.hb.by/v1/domains/29303/certificate\r\n```\r\n            \r\nПример ответа:\r\n            \r\n```\r\n{\r\n  \"url\": \"some url\"\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>url</strong> — публичная ссылка (URL) на ресурс.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/GetDomainCertificateResponseDto"
							}
						}
					}
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/servers": {
		"get": {
			"tags": [
				"DomainApi"
			],
			"summary": "Получить список NS серверов домена",
			"description": "Пример запроса:\r\n            \r\n```\r\n// GET https://api.hb.by/v1/domains/29303/dns/servers\r\n```\r\n            \r\nПример ответа:\r\n            \r\n```\r\n{\r\n  \"servers\": [\r\n    {\r\n      \"ns\": \"ns1.hb.by\",\r\n      \"ip\": null\r\n    },\r\n    {\r\n      \"ns\": \"ns2.hb.by\",\r\n      \"ip\": null\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>servers</strong> — список серверов имён.\r\n</li>\r\n<li><strong>ns</strong> — имя сервера имён.\r\n</li>\r\n<li><strong>ip</strong> — IP-адрес сервера (может быть null, если адрес не указан).\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/GetDnsServersResponseDto"
							}
						}
					}
				}
			}
		},
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить NS сервера домена",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/servers\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/servers/hosting": {
      "put": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Обновить список NS серверов домена на виртуальный хостинг",
        "description": "Пример запроса:\r\n            \r\n```\r\n// PUT https://api.hb.by/v1/domains/29303/dns/servers/hosting\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/servers/editor": {
      "put": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Обновить список NS серверов домена на расширенный редактор",
        "description": "Пример запроса:\r\n            \r\n```\r\n// PUT https://api.hb.by/v1/domains/29303/dns/servers/editor\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/servers/custom": {
		"put": {
			"tags": [
				"DomainApi"
			],
			"summary": "Обновить список NS серверов домена на указанные",
			"description": "Пример запроса:\r\n            \r\n```\r\n// PUT https://api.hb.by/v1/domains/29303/dns/servers/custom\r\n{\r\n  \"servers\": [\r\n    {\r\n      \"ns\": \"ns1.mydomain.by\",\r\n      \"ip\": \"100.100.100.100\"\r\n    },\r\n    {\r\n      \"ns\": \"ns2.mydomain.by\",\r\n      \"ip\": \"200.200.200.200\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>servers</strong> — список серверов имён.\r\n</li>\r\n<li><strong>ns</strong> — имя сервера имён.\r\n</li>\r\n<li><strong>ip</strong> — IP-адрес сервера (может быть null, если адрес не указан).\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PutDnsServersAsCustomRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records": {
		"get": {
			"tags": [
				"DomainApi"
			],
			"summary": "Получить список DNS записей домена",
			"description": "Пример запроса:\r\n            \r\n```\r\n// GET https://api.hb.by/v1/domains/29303/dns/records\r\n```\r\n            \r\nПример ответа:\r\n            \r\n```\r\n{\r\n  \"records\": [\r\n    {\r\n      \"record_id\": 1000,\r\n      \"type\": \"A\",\r\n      \"ttl\": 86400,\r\n      \"value\": \"www 100.100.100.100\"\r\n    }\r\n  ]\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>record_id</strong> — уникальный идентификатор записи.\r\n</li>\r\n<li><strong>type</strong> — тип записи.\r\n</li>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>value</strong> — значение записи (содержимое, на которое указывает запись).\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/GetDnsRecordsResponseDto"
							}
						}
					}
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/ns": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Добавить NS запись",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/29303/dns/records/ns\r\n{\r\n  \"ttl\": 60,\r\n  \"host\": \"ns1\",\r\n  \"ns\": \"ns1.mydomain.by\"\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>host</strong> — имя хоста или поддомена, для которого создаётся запись.\r\n</li>\r\n<li><strong>ns</strong> — полный домен сервера имён, на который должна указывать запись.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostDnsRecordNsRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/ns/{id}": {
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить NS запись",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/records/ns/1000\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/records/a": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Добавить A запись",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/29303/dns/records/a\r\n{\r\n  \"ttl\": 60,\r\n  \"host\": \"www\",\r\n  \"ipv4\": \"100.100.100.100\"\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>host</strong> — поддомен/метка, для которой создаётся A-запись.\r\n</li>\r\n<li><strong>ipv4</strong> — IPv4-адрес в формате x.x.x.x.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostDnsRecordARequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/a/{id}": {
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить A запись",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/records/a/1000\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/records/aaaa": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Добавить AAAA запись",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/29303/dns/records/aaaa\r\n{\r\n  \"ttl\": 60,\r\n  \"host\": \"www6\",\r\n  \"ipv6\": \"2001:0db8:85a3:0000:0000:8a2e:0370:7334\"\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>host</strong> — имя хоста или поддомена, для которого создаётся запись.\r\n</li>\r\n<li><strong>ipv6</strong> — IPv6-адрес, на который должна указывать запись.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostDnsRecordAaaaRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/aaaa/{id}": {
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить AAAA запись",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/records/aaaa/1000\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/records/cname": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Добавить CNAME запись",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/29303/dns/records/cname\r\n{\r\n  \"ttl\": 60,\r\n  \"host\": \"www\",\r\n  \"canonical\": \"mydomain.by\"\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>host</strong> — поддомен/метка, для которой создаётся CNAME.\r\n</li>\r\n<li><strong>canonical</strong> — каноническое имя, на которое будет указывать CNAME.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostDnsRecordCnameRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/cname/{id}": {
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить CNAME запись",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/records/cname/1000\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID записи",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/records/mx": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Добавить MX запись",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/29303/dns/records/mx\r\n{\r\n  \"ttl\": 60,\r\n  \"host\": \"ml\",\r\n  \"mail_server\": \"mail.mydomain.by\",\r\n  \"priority\": 10\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>host</strong> — поддомен или метка, к которому привязана запись.\r\n</li>\r\n<li><strong>mail_server</strong> — полный домен почтового сервера, на который нужно направлять почту.\r\n</li>\r\n<li><strong>priority</strong> — приоритет почтового сервера; меньшее значение = более высокий приоритет.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostDnsRecordMxRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/mx/{id}": {
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить MX запись",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/records/mx/1000\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID записи",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/records/txt": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Добавить TXT запись",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/29303/dns/records/txt\r\n{\r\n  \"ttl\": 60,\r\n  \"host\": \"_spf\",\r\n  \"text\": \"v=spf1 +mx +a -all\"\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>host</strong> — имя хоста или поддомена, для которого создаётся запись.\r\n</li>\r\n<li><strong>text</strong> — текстовое значение записи.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostDnsRecordTxtRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/txt/{id}": {
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить TXT запись",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/records/txt/1000\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID записи",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/domains/{orderId}/dns/records/srv": {
		"post": {
			"tags": [
				"DomainApi"
			],
			"summary": "Добавить SRV запись",
			"description": "Пример запроса:\r\n            \r\n```\r\n// POST https://api.hb.by/v1/domains/29303/dns/records/srv\r\n{\r\n  \"ttl\": 60,\r\n  \"host\": \"service\",\r\n  \"service\": \"sip\",\r\n  \"protocol\": \"tcp\",\r\n  \"target\": \"sipserver.mydomain.by\",\r\n  \"port\": 5060,\r\n  \"priority\": 0,\r\n  \"weight\": 10\r\n}\r\n```\r\n\r\n```\r\n<ul>\r\n<li><strong>ttl</strong> — время жизни записи в секундах.\r\n</li>\r\n<li><strong>host</strong> — имя хоста или поддомена, для которого создаётся запись.\r\n</li>\r\n<li><strong>service</strong> — название сервиса.\r\n</li>\r\n<li><strong>protocol</strong> — протокол.\r\n</li>\r\n<li><strong>target</strong> — адрес сервера, к которому должна указывать SRV-запись.\r\n</li>\r\n<li><strong>port</strong> — номер порта на целевом сервере.\r\n</li>\r\n<li><strong>priority</strong> — приоритет записи; меньшие значения означают более высокий приоритет.\r\n</li>\r\n<li><strong>weight</strong> — относительный вес записи при одинаковом приоритете.\r\n</li>\r\n</ul>\r\n```",
			"parameters": [
				{
					"name": "x-auth-token",
					"in": "header",
					"description": "API-ключ",
					"schema": {
						"type": "string"
					}
				},
				{
					"name": "orderId",
					"in": "path",
					"description": "ID заказа",
					"required": true,
					"schema": {
						"type": "integer",
						"format": "int32"
					}
				}
			],
			"requestBody": {
				"content": {
					"application/json": {
						"schema": {
							"$ref": "#/components/schemas/PostDnsRecordSrvRequestDto"
						}
					}
				}
			},
			"responses": {
				"400": {
					"description": "Bad Request",
					"content": {
						"application/json": {
							"schema": {
								"$ref": "#/components/schemas/ErrorResponseDto"
							}
						}
					}
				},
				"500": {
					"description": "Internal Server Error"
				},
				"403": {
					"description": "Forbidden"
				},
				"404": {
					"description": "Not Found"
				},
				"200": {
					"description": "OK"
				}
			}
		}
    },
    "/v1/domains/{orderId}/dns/records/srv/{id}": {
      "delete": {
        "tags": [
          "DomainApi"
        ],
        "summary": "Удалить SRV запись",
        "description": "Пример запроса:\r\n            \r\n```\r\n// DELETE https://api.hb.by/v1/domains/29303/dns/records/srv/1000\r\n```",
        "parameters": [
          {
            "name": "x-auth-token",
            "in": "header",
            "description": "API-ключ",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "path",
            "description": "ID заказа",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "ID записи",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          },
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "DnsRecord": {
        "required": [
          "record_id",
          "ttl",
          "type",
          "value"
        ],
        "type": "object",
        "properties": {
          "record_id": {
            "type": "integer",
            "description": "ID записи",
            "format": "int32"
          },
          "type": {
            "minLength": 1,
            "type": "string",
            "description": "Тип записи"
          },
          "ttl": {
            "type": "integer",
            "description": "Тип записи",
            "format": "int32"
          },
          "value": {
            "minLength": 1,
            "type": "string",
            "description": "Значение"
          }
        },
        "additionalProperties": false,
        "description": "DTO ответа"
      },
      "DnsServerDto": {
        "required": [
          "ns"
        ],
        "type": "object",
        "properties": {
          "ns": {
            "minLength": 1,
            "type": "string",
            "description": "NS"
          },
          "ip": {
            "type": "string",
            "description": "IP",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO ответа"
      },
      "DomainCheckResultDto": {
        "required": [
          "domain",
          "is_available",
          "is_premium",
          "state"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "minLength": 1,
            "type": "string",
            "description": "Домен"
          },
          "is_available": {
            "type": "boolean",
            "description": "Статус доступности"
          },
          "is_premium": {
            "type": "boolean",
            "description": "Статус премиальности"
          },
          "state": {
            "minLength": 1,
            "type": "string",
            "description": "Статус в реестре"
          }
        },
        "additionalProperties": false,
        "description": "DTO ответа"
      },
      "ErrorResponseDto": {
        "required": [
          "message"
        ],
        "type": "object",
        "properties": {
          "message": {
            "type": "string",
            "description": "Сообщение об ошибке",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "DTO сообщения об ошибке"
      },
      "GetDnsRecordsResponseDto": {
        "required": [
          "records"
        ],
        "type": "object",
        "properties": {
          "records": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsRecord"
            },
            "description": "Список записей"
          }
        },
        "additionalProperties": false,
        "description": "DTO ответа"
      },
      "GetDnsServersResponseDto": {
        "required": [
          "servers"
        ],
        "type": "object",
        "properties": {
          "servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsServerDto"
            },
            "description": "Список NS-серверов"
          }
        },
        "additionalProperties": false,
        "description": "DTO ответа"
      },
      "GetDomainCertificateResponseDto": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "minLength": 1,
            "type": "string",
            "description": "Url"
          }
        },
        "additionalProperties": false,
        "description": "DTO ответа"
      },
      "PostCheckResultRequestDto": {
        "required": [
          "domains"
        ],
        "type": "object",
        "properties": {
          "domains": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Домены"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PostCheckResultResponseDto": {
        "required": [
          "results"
        ],
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DomainCheckResultDto"
            },
            "description": "Результаты проверки"
          }
        },
        "additionalProperties": false,
        "description": "DTO ответа"
      },
      "PostDnsRecordARequestDto": {
        "required": [
          "host",
          "ipv4",
          "ttl"
        ],
        "type": "object",
        "properties": {
          "ttl": {
            "type": "integer",
            "description": "TTL",
            "format": "int32"
          },
          "host": {
            "minLength": 1,
            "type": "string",
            "description": "Хост (поддомен)"
          },
          "ipv4": {
            "minLength": 1,
            "type": "string",
            "description": "IPv4"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PostDnsRecordAaaaRequestDto": {
        "required": [
          "host",
          "ipv6",
          "ttl"
        ],
        "type": "object",
        "properties": {
          "ttl": {
            "type": "integer",
            "description": "TTL",
            "format": "int32"
          },
          "host": {
            "minLength": 1,
            "type": "string",
            "description": "Хост (поддомен)"
          },
          "ipv6": {
            "minLength": 1,
            "type": "string",
            "description": "IPv4"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PostDnsRecordCnameRequestDto": {
        "required": [
          "canonical",
          "host",
          "ttl"
        ],
        "type": "object",
        "properties": {
          "ttl": {
            "type": "integer",
            "description": "TTL",
            "format": "int32"
          },
          "host": {
            "minLength": 1,
            "type": "string",
            "description": "Хост (поддомен)"
          },
          "canonical": {
            "minLength": 1,
            "type": "string",
            "description": "Каноническое имя"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PostDnsRecordMxRequestDto": {
        "required": [
          "host",
          "mail_server",
          "priority",
          "ttl"
        ],
        "type": "object",
        "properties": {
          "ttl": {
            "type": "integer",
            "description": "TTL",
            "format": "int32"
          },
          "host": {
            "minLength": 1,
            "type": "string",
            "description": "Хост (поддомен)"
          },
          "mail_server": {
            "minLength": 1,
            "type": "string",
            "description": "Почтовый сервер"
          },
          "priority": {
            "type": "integer",
            "description": "Приоритет",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PostDnsRecordNsRequestDto": {
        "required": [
          "host",
          "ns",
          "ttl"
        ],
        "type": "object",
        "properties": {
          "ttl": {
            "type": "integer",
            "description": "TTL",
            "format": "int32"
          },
          "host": {
            "minLength": 1,
            "type": "string",
            "description": "Хост (поддомен)"
          },
          "ns": {
            "minLength": 1,
            "type": "string",
            "description": "NS-сервер"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PostDnsRecordSrvRequestDto": {
        "required": [
          "host",
          "port",
          "priority",
          "protocol",
          "service",
          "target",
          "ttl",
          "weight"
        ],
        "type": "object",
        "properties": {
          "ttl": {
            "type": "integer",
            "description": "TTL",
            "format": "int32"
          },
          "host": {
            "minLength": 1,
            "type": "string",
            "description": "Хост (поддомен)"
          },
          "service": {
            "minLength": 1,
            "type": "string",
            "description": "Сервис"
          },
          "protocol": {
            "minLength": 1,
            "type": "string",
            "description": "Протокол"
          },
          "target": {
            "minLength": 1,
            "type": "string",
            "description": "Цель"
          },
          "port": {
            "type": "integer",
            "description": "Порт",
            "format": "int32"
          },
          "priority": {
            "type": "integer",
            "description": "Приоритет",
            "format": "int32"
          },
          "weight": {
            "type": "integer",
            "description": "Вес",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PostDnsRecordTxtRequestDto": {
        "required": [
          "host",
          "text",
          "ttl"
        ],
        "type": "object",
        "properties": {
          "ttl": {
            "type": "integer",
            "description": "TTL",
            "format": "int32"
          },
          "host": {
            "minLength": 1,
            "type": "string",
            "description": "Хост (поддомен)"
          },
          "text": {
            "minLength": 1,
            "type": "string",
            "description": "Текстовое значение"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      },
      "PutDnsServersAsCustomRequestDto": {
        "required": [
          "servers"
        ],
        "type": "object",
        "properties": {
          "servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DnsServerDto"
            },
            "description": "Список NS-серверов"
          }
        },
        "additionalProperties": false,
        "description": "DTO запроса"
      }
    }
  },
  "tags": [
    {
      "name": "DomainApi",
      "description": "API для работы с доменами"
    }
  ]
}
