{
  "openapi": "3.1.0",
  "info": {
    "title": "DNS APIs",
    "description": "DNS zone record management for domain orders: A, AAAA, CNAME, MX, NS, PTR, SRV,\nand TXT records (create, update, delete, and list).\n",
    "version": "2.0.0"
  },
  "servers": [
    {
      "url": "https://api.sandbox.resellerclub.com/v2",
      "description": "Sandbox"
    },
    {
      "url": "https://api.resellerclub.com/v2",
      "description": "Live"
    }
  ],
  "security": [
    {
      "apiKeyAuth": [],
      "userIdHeader": []
    }
  ],
  "paths": {
    "/dns/zones/{domainName}/records": {
      "get": {
        "tags": [
          "APIs"
        ],
        "summary": "Search DNS records",
        "description": "Returns DNS records matching the search criteria, with pagination.",
        "operationId": "listDnsRecords",
        "parameters": [
          {
            "name": "domainName",
            "in": "path",
            "description": "The Domain name whose DNS record(s) you want to search",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recordType",
            "in": "query",
            "description": "Type of record. Values may be: A MX CNAME TXT NS SRV AAAA",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "description": "Number of Resource Records to be fetched",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number for which details are to be fetched",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "host",
            "in": "query",
            "description": "Hostname of the record",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "value",
            "in": "query",
            "description": "Value of the record",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ListDnsRecordsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ListDnsRecordsResponse"
      },
      "put": {
        "tags": [
          "APIs"
        ],
        "summary": "Update a DNS record",
        "description": "Updates a DNS record in the zone. The record type is selected via the request body.",
        "operationId": "updateDnsRecord",
        "parameters": [
          {
            "name": "domainName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDnsRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/DnsMutationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "APIs"
        ],
        "summary": "Create a DNS record",
        "description": "Creates a DNS record in the zone. The record type is selected via the request body.",
        "operationId": "createDnsRecord",
        "parameters": [
          {
            "name": "domainName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDnsRecordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/DnsMutationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "APIs"
        ],
        "summary": "Delete a DNS record",
        "description": "Deletes a DNS record from the zone. The record type is selected via the request body.",
        "operationId": "deleteDnsRecord",
        "parameters": [
          {
            "name": "domainName",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteDnsRecordByTypeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/DnsMutationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{orderId}/dns": {
      "post": {
        "tags": [
          "APIs"
        ],
        "summary": "Activate DNS service for an order",
        "description": "Returns DNS activation status for the order.",
        "operationId": "activateDnsService",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "description": "Order Id of the Order for which the DNS service is to be activated",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/ActivateDnsServiceResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/GenericResponse"
                }
              }
            }
          }
        },
        "x-v2-response-schema": "ActivateDnsServiceResponse"
      }
    }
  },
  "components": {
    "schemas": {
      "GenericResponse": {
        "type": "object",
        "properties": {
          "message": {
            "type": "string"
          },
          "path": {
            "type": "string"
          },
          "status": {
            "type": "integer",
            "format": "int32"
          },
          "customLogMessage": {}
        }
      },
      "UpdateDnsRecordRequest": {
        "type": "object",
        "description": "Updates an existing DNS record of the specified type.",
        "properties": {
          "recordType": {
            "type": "string",
            "description": "DNS record type to update.",
            "enum": [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "NS",
              "TXT",
              "SRV",
              "PTR"
            ]
          },
          "currentValue": {
            "type": "string",
            "description": "Current record value to match.",
            "minLength": 1
          },
          "value": {
            "type": "string",
            "description": "New record value.",
            "minLength": 1
          },
          "host": {
            "type": "string",
            "description": "Host label for the record."
          },
          "ttl": {
            "type": "integer",
            "format": "int32",
            "description": "Time to live in seconds."
          },
          "priority": {
            "type": "integer",
            "format": "int32",
            "description": "Priority for MX or SRV records."
          },
          "weight": {
            "type": "integer",
            "format": "int32",
            "description": "Weight for SRV records."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "description": "Port for SRV records."
          }
        },
        "required": [
          "currentValue",
          "recordType",
          "value"
        ]
      },
      "DnsPendingInvoicesDto": {
        "type": "object",
        "description": "Pending invoice details returned when DNS activation requires payment.",
        "properties": {
          "totalItems": {
            "type": "integer",
            "format": "int32",
            "description": "Total pending invoices (`recsindb`)"
          },
          "itemsOnPage": {
            "type": "integer",
            "format": "int32",
            "description": "Pending invoices on this page (`recsonpage`)"
          },
          "invoices": {
            "type": "array",
            "description": "Pending invoice entries in list order",
            "items": {
              "$ref": "#/components/schemas/PendingInvoiceDto"
            }
          }
        }
      },
      "PendingInvoiceDto": {
        "type": "object",
        "description": "Pending invoice entry.",
        "properties": {
          "invoiceId": {
            "type": "string",
            "description": "Invoice identifier"
          },
          "transactionId": {
            "type": "string",
            "description": "Transaction identifier"
          },
          "amount": {
            "type": "string",
            "description": "Invoice amount"
          },
          "currencySymbol": {
            "type": "string",
            "description": "Currency symbol"
          },
          "description": {
            "type": "string",
            "description": "Invoice description"
          }
        }
      },
      "CreateDnsRecordRequest": {
        "type": "object",
        "description": "Creates a DNS record of the specified type in the zone.",
        "properties": {
          "recordType": {
            "type": "string",
            "description": "DNS record type (A, AAAA, CNAME, MX, NS, TXT, SRV, PTR).",
            "enum": [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "NS",
              "TXT",
              "SRV",
              "PTR"
            ]
          },
          "value": {
            "type": "string",
            "description": "Record value (IPv4, IPv6, hostname, or text depending on record type).",
            "minLength": 1
          },
          "host": {
            "type": "string",
            "description": "Host label for the record."
          },
          "ttl": {
            "type": "integer",
            "format": "int32",
            "description": "Time to live in seconds."
          },
          "priority": {
            "type": "integer",
            "format": "int32",
            "description": "Priority for MX or SRV records."
          },
          "weight": {
            "type": "integer",
            "format": "int32",
            "description": "Weight for SRV records."
          },
          "port": {
            "type": "integer",
            "format": "int32",
            "description": "Port for SRV records."
          }
        },
        "required": [
          "recordType",
          "value"
        ]
      },
      "DnsRecordEntryDto": {
        "type": "object",
        "properties": {
          "host": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "ttl": {
            "type": "integer",
            "format": "int32"
          },
          "status": {
            "type": "string"
          },
          "recordType": {
            "type": "string"
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "weight": {
            "type": "integer",
            "format": "int32"
          },
          "port": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "DeleteDnsRecordByTypeRequest": {
        "type": "object",
        "description": "Deletes a DNS record of the specified type.",
        "properties": {
          "recordType": {
            "type": "string",
            "description": "DNS record type to delete.",
            "enum": [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "NS",
              "TXT",
              "SRV",
              "PTR"
            ]
          },
          "value": {
            "type": "string",
            "description": "Record value to delete.",
            "minLength": 1
          },
          "host": {
            "type": "string",
            "description": "Host label for the record."
          }
        },
        "required": [
          "recordType",
          "value"
        ]
      },
      "ActivateDnsServiceResponse": {
        "type": "object",
        "description": "Returns DNS activation status for the order.",
        "properties": {
          "status": {
            "type": "string",
            "description": "Operation status"
          },
          "message": {
            "type": "string",
            "description": "Status message (`msg` in the response)"
          },
          "zoneId": {
            "type": "string",
            "description": "DNS zone identifier"
          },
          "transactionId": {
            "type": "string",
            "description": "Transaction identifier when returned in the response"
          },
          "pendingInvoices": {
            "$ref": "#/components/schemas/DnsPendingInvoicesDto",
            "description": "Pending invoice details when activation requires payment"
          }
        }
      },
      "DnsMutationResponse": {
        "type": "object",
        "description": "Result of a DNS record create, update, or delete operation.",
        "properties": {
          "status": {
            "type": "string",
            "description": "Operation status."
          },
          "message": {
            "type": "string",
            "description": "Human-readable result message."
          },
          "transactionId": {
            "type": "string",
            "description": "Transaction identifier when returned by the service."
          }
        }
      },
      "ListDnsRecordsResponse": {
        "type": "object",
        "description": "Returns DNS records matching the search criteria, with pagination.",
        "properties": {
          "totalItems": {
            "type": "integer",
            "format": "int32",
            "description": "Total matching records"
          },
          "itemsOnPage": {
            "type": "integer",
            "format": "int32",
            "description": "Records on this page"
          },
          "records": {
            "type": "array",
            "description": "DNS record entries",
            "items": {
              "$ref": "#/components/schemas/DnsRecordEntryDto"
            }
          },
          "status": {
            "type": "string",
            "description": "Operation status"
          },
          "message": {
            "type": "string",
            "description": "Status message"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKeyAuth": {
        "type": "apiKey",
        "description": "Reseller API key. In your own requests, send the full header value: Authorization: ApiKey YOUR_API_KEY",
        "name": "Authorization",
        "in": "header"
      },
      "userIdHeader": {
        "type": "apiKey",
        "description": "Reseller user ID",
        "name": "X-User-Id",
        "in": "header"
      }
    }
  },
  "tags": [
    {
      "name": "APIs"
    }
  ]
}