{
  "openapi": "3.1.0",
  "info": {
    "title": "NexoISP Cloud Administration API",
    "version": "1.0.0",
    "description": "Platform-owner API, separate from OLT and the operational API of each ISP. Registration and access changes are asynchronous. Prices use integer cents; periods are 3, 6 and 12 months. Demo activation is automatic only after verified provisioning; license payment approval is manual."
  },
  "servers": [
    {
      "url": "https://admin.nexos.com.do/api/admin/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "ispAdminKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "nxi_<64 hexadecimal characters>"
      }
    }
  },
  "paths": {
    "/isp-companies": {
      "get": {
        "summary": "List NexoISP cloud companies",
        "operationId": "get__isp-companies",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:read. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        }
      },
      "post": {
        "summary": "Register company; email verification precedes provisioning",
        "operationId": "post__isp-companies",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_name",
                  "name",
                  "email",
                  "slug",
                  "password"
                ],
                "properties": {
                  "company_name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{1,40}[a-z0-9]$"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "minLength": 14,
                    "maxLength": 200
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "company_name",
                  "name",
                  "email",
                  "slug",
                  "password"
                ],
                "properties": {
                  "company_name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "slug": {
                    "type": "string",
                    "pattern": "^[a-z][a-z0-9-]{1,40}[a-z0-9]$"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40
                  },
                  "password": {
                    "type": "string",
                    "format": "password",
                    "minLength": 14,
                    "maxLength": 200
                  }
                }
              }
            }
          }
        }
      }
    },
    "/isp-companies/{id}": {
      "get": {
        "summary": "Read company and license requests",
        "operationId": "get__isp-companies_id",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:read. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/isp-companies/{id}/suspend": {
      "post": {
        "summary": "Suspend operations; billing portal remains accessible",
        "operationId": "post__isp-companies_id_suspend",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/isp-companies/{id}/resume": {
      "post": {
        "summary": "Remove manual suspension; a current license is still required",
        "operationId": "post__isp-companies_id_resume",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/isp-companies/{id}/retry": {
      "post": {
        "summary": "Retry failed provisioning after review",
        "operationId": "post__isp-companies_id_retry",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/isp-companies/{id}/backup": {
      "post": {
        "summary": "Queue an encrypted full company backup",
        "operationId": "post__isp-companies_id_backup",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/isp-companies/{id}/pricing": {
      "post": {
        "summary": "Set price per company; null inherits the general tariff",
        "operationId": "post__isp-companies_id_pricing",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "monthly_cents",
                  "currency"
                ],
                "properties": {
                  "monthly_cents": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "USD",
                      "DOP",
                      "EUR"
                    ]
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "monthly_cents",
                  "currency"
                ],
                "properties": {
                  "monthly_cents": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0,
                    "maximum": 9999999999
                  },
                  "currency": {
                    "type": "string",
                    "enum": [
                      "USD",
                      "DOP",
                      "EUR"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/isp-payment-requests": {
      "get": {
        "summary": "List license requests and payments",
        "operationId": "get__isp-payment-requests",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:read. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        }
      }
    },
    "/isp-payment-requests/{id}/approve": {
      "post": {
        "summary": "Confirm verified payment and extend the license once",
        "operationId": "post__isp-payment-requests_id_approve",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "payment_reference"
                ],
                "properties": {
                  "payment_reference": {
                    "type": "string",
                    "maxLength": 190
                  }
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "payment_reference"
                ],
                "properties": {
                  "payment_reference": {
                    "type": "string",
                    "maxLength": 190
                  }
                }
              }
            }
          }
        }
      }
    },
    "/isp-payment-requests/{id}/reject": {
      "post": {
        "summary": "Reject a pending request",
        "operationId": "post__isp-payment-requests_id_reject",
        "security": [
          {
            "ispAdminKey": []
          }
        ],
        "description": "Required scope: companies:write. No OLT or operational ISP credentials are accepted.",
        "responses": {
          "200": {
            "description": "Success; see success/data envelope"
          },
          "400": {
            "description": "Malformed request"
          },
          "401": {
            "description": "Invalid or missing ISP administrative key"
          },
          "403": {
            "description": "Insufficient scope or incorrect product"
          },
          "404": {
            "description": "Not found"
          },
          "409": {
            "description": "Invalid business state or already processed"
          },
          "413": {
            "description": "Body exceeds 64 KiB"
          },
          "415": {
            "description": "Use application/json or application/x-www-form-urlencoded"
          }
        },
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ]
      }
    }
  }
}