{
  "openapi": "3.1.0",
  "info": {
    "title": "OXRO Management Console API",
    "version": "0.3.0",
    "description": "OXRO shared-workspace management API. Role-based users, packages, rooms and diagnostics. No tenant isolation, billing or media service. See integration guide."
  },
  "servers": [
    {
      "url": "https://node.orc-server.roketdns.com"
    }
  ],
  "paths": {
    "/healthz": {
      "get": {
        "operationId": "healthz",
        "summary": "Process liveness",
        "description": "Does not check dependencies on each request.",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/login": {
      "post": {
        "operationId": "login",
        "summary": "Create an 8-hour session",
        "description": "",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                },
                "description": "__Host-oxro; Secure; HttpOnly; SameSite=Strict; Path=/. 8 hours at login; Max-Age=0 at logout."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        }
      }
    },
    "/api/me": {
      "get": {
        "operationId": "me",
        "summary": "Read current session and CSRF",
        "description": "",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/logout": {
      "post": {
        "operationId": "logout",
        "summary": "Revoke current session",
        "description": "Body is not parsed. Repeated call with revoked session returns 401.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              },
              "Set-Cookie": {
                "schema": {
                  "type": "string"
                },
                "description": "__Host-oxro; Secure; HttpOnly; SameSite=Strict; Path=/. 8 hours at login; Max-Age=0 at logout."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          }
        ]
      }
    },
    "/api/overview": {
      "get": {
        "operationId": "overview",
        "summary": "List recent rooms, events and health",
        "description": "Latest 500 rooms including archived, latest 50 events. No pagination/filtering or total counts.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overview"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/rooms": {
      "post": {
        "operationId": "createRoom",
        "summary": "Create a planned room",
        "description": "Admin/operator only. No media allocation or idempotency key. Global 200 planned-room limit enforced under advisory lock.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomInput"
              }
            }
          }
        }
      }
    },
    "/api/rooms/{id}/archive": {
      "post": {
        "operationId": "archiveRoom",
        "summary": "Archive a planned room",
        "description": "Missing or already archived room returns 404 ROOM_NOT_FOUND. Body is not parsed.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Use the exact lowercase UUID returned by createRoom."
          }
        ]
      }
    },
    "/api/lab/catalog": {
      "get": {
        "operationId": "labCatalog",
        "summary": "List 30 feature headings",
        "description": "",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/lab/run": {
      "post": {
        "operationId": "labRun",
        "summary": "Run seven live server diagnostics",
        "description": "Admin only. Seven server checks; 200 can include failed results.",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Request correlation identifier"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LabReport"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/dashboard": {
      "get": {
        "operationId": "dashboard",
        "summary": "All roles: complete counts and 14 UTC days",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "counts": {
                      "type": "object",
                      "properties": {
                        "planned": {
                          "type": "integer"
                        },
                        "archived": {
                          "type": "integer"
                        },
                        "capacity": {
                          "type": "integer"
                        },
                        "active_users": {
                          "type": "integer"
                        },
                        "disabled_users": {
                          "type": "integer"
                        },
                        "active_packages": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "planned",
                        "archived",
                        "capacity",
                        "active_users",
                        "disabled_users",
                        "active_packages"
                      ],
                      "additionalProperties": false
                    },
                    "trend": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string"
                          },
                          "rooms": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "day",
                          "rooms"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "mediaEnabled": {
                      "const": false
                    },
                    "billingEnabled": {
                      "const": false
                    }
                  },
                  "required": [
                    "counts",
                    "trend",
                    "mediaEnabled",
                    "billingEnabled"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/users": {
      "get": {
        "operationId": "listUsers",
        "summary": "Admin: latest 1000 users including deleted",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "username": {
                            "type": "string"
                          },
                          "role": {
                            "enum": [
                              "admin",
                              "operator",
                              "viewer"
                            ]
                          },
                          "status": {
                            "enum": [
                              "active",
                              "disabled",
                              "deleted"
                            ]
                          },
                          "package_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uuid"
                          },
                          "package_name": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "id",
                          "username",
                          "role",
                          "status",
                          "package_id",
                          "package_name",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "users"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createUser",
        "summary": "Admin: create user",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreate"
              }
            }
          }
        }
      }
    },
    "/api/users/{id}/update": {
      "post": {
        "operationId": "updateUser",
        "summary": "Admin: update role/status/package and revoke sessions",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              }
            }
          }
        }
      }
    },
    "/api/users/{id}/delete": {
      "post": {
        "operationId": "deleteUser",
        "summary": "Admin: logical deletion preserving history",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/users/{id}/password": {
      "post": {
        "operationId": "resetUserPassword",
        "summary": "Admin: reset password and revoke sessions",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "password": {
                    "type": "string",
                    "format": "password"
                  }
                },
                "required": [
                  "password"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/packages": {
      "get": {
        "operationId": "listPackages",
        "summary": "Admin: latest 500 catalog packages; no billing or enforced quotas",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "packages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "price_minor": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100000000
                          },
                          "currency": {
                            "enum": [
                              "TRY",
                              "USD",
                              "EUR"
                            ]
                          },
                          "billing_period": {
                            "enum": [
                              "monthly",
                              "yearly"
                            ]
                          },
                          "room_limit": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 200
                          },
                          "capacity": {
                            "type": "integer",
                            "minimum": 2,
                            "maximum": 500
                          },
                          "status": {
                            "enum": [
                              "active",
                              "archived"
                            ]
                          },
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          },
                          "assigned_users": {
                            "type": "integer"
                          }
                        },
                        "required": [
                          "name",
                          "description",
                          "price_minor",
                          "currency",
                          "billing_period",
                          "room_limit",
                          "capacity",
                          "status",
                          "id",
                          "created_at",
                          "updated_at",
                          "assigned_users"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "billingEnabled": {
                      "const": false
                    },
                    "quotaEnforced": {
                      "const": false
                    }
                  },
                  "required": [
                    "packages",
                    "billingEnabled",
                    "quotaEnforced"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createPackage",
        "summary": "Admin: create package",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageInput"
              }
            }
          }
        }
      }
    },
    "/api/packages/{id}/update": {
      "post": {
        "operationId": "updatePackage",
        "summary": "Admin: replace catalog fields",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackageInput"
              }
            }
          }
        }
      }
    },
    "/api/packages/{id}/delete": {
      "post": {
        "operationId": "deletePackage",
        "summary": "Admin: delete unassigned package",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/audit": {
      "get": {
        "operationId": "listAudit",
        "summary": "Admin: last 200 management changes",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "actor": {
                            "type": "string"
                          },
                          "action": {
                            "type": "string"
                          },
                          "target_id": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uuid"
                          },
                          "detail": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "actor",
                          "action",
                          "target_id",
                          "detail",
                          "created_at"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "events"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/account/password": {
      "post": {
        "operationId": "changeOwnPassword",
        "summary": "All roles: password change, re-login required",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "reauthenticate": {
                      "const": true
                    }
                  },
                  "required": [
                    "ok",
                    "reauthenticate"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current_password": {
                    "type": "string",
                    "format": "password"
                  },
                  "new_password": {
                    "type": "string",
                    "format": "password"
                  }
                },
                "required": [
                  "current_password",
                  "new_password"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/api/rooms/{id}/update": {
      "post": {
        "operationId": "updateRoom",
        "summary": "Admin/operator: update existing room",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoomInput"
              }
            }
          }
        }
      }
    },
    "/api/rooms/{id}/restore": {
      "post": {
        "operationId": "restoreRoom",
        "summary": "Admin/operator: restore archived room; global limit 200",
        "security": [
          {
            "cookieAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "default": {
            "description": "Application error; proxy/network errors may be non-JSON. See integration guide.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                },
                "description": "Seconds on 429"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "https://node.orc-server.roketdns.com"
            },
            "description": "Required on every POST, including login."
          },
          {
            "name": "X-CSRF-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Value from login or me for this cookie session."
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-oxro"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": true
      },
      "Session": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string"
          },
          "csrf": {
            "type": "string"
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "role": {
            "enum": [
              "admin",
              "operator",
              "viewer"
            ]
          },
          "auth_version": {
            "type": "integer"
          }
        },
        "required": [
          "username",
          "csrf"
        ],
        "additionalProperties": true
      },
      "Ok": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": false
      },
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "const": "ok"
          },
          "service": {
            "const": "oxro-console"
          }
        },
        "required": [
          "status",
          "service"
        ],
        "additionalProperties": false
      },
      "Login": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "description": "Maximum 64 JavaScript UTF-16 code units before normalization; see guide."
          },
          "password": {
            "type": "string",
            "format": "password",
            "description": "Maximum 256 JavaScript UTF-16 code units before normalization; see guide."
          }
        },
        "required": [
          "username",
          "password"
        ],
        "additionalProperties": true
      },
      "RoomInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Trimmed length 2â€“80 UTF-16 code units."
          },
          "description": {
            "type": "string",
            "default": "",
            "description": "Maximum 500 UTF-16 code units before trim."
          },
          "capacity": {
            "type": "integer",
            "minimum": 2,
            "maximum": 500
          }
        },
        "required": [
          "name",
          "capacity"
        ],
        "additionalProperties": false
      },
      "Room": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "capacity": {
            "type": "integer",
            "minimum": 2,
            "maximum": 500
          },
          "status": {
            "enum": [
              "planned",
              "archived"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "capacity",
          "status",
          "created_at"
        ],
        "additionalProperties": true
      },
      "Event": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string"
          },
          "room_name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "action",
          "room_name",
          "created_at"
        ],
        "additionalProperties": true
      },
      "Overview": {
        "type": "object",
        "properties": {
          "rooms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Room"
            },
            "maxItems": 500
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Event"
            },
            "maxItems": 50
          },
          "health": {
            "type": "object",
            "properties": {
              "postgres": {
                "type": "boolean"
              },
              "redis": {
                "type": "boolean"
              }
            },
            "required": [
              "postgres",
              "redis"
            ],
            "additionalProperties": false
          },
          "version": {
            "type": "string"
          },
          "scope": {
            "const": "management-console"
          },
          "mediaEnabled": {
            "const": false
          }
        },
        "required": [
          "rooms",
          "events",
          "health",
          "version",
          "scope",
          "mediaEnabled"
        ],
        "additionalProperties": true
      },
      "Feature": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "group": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "runner": {
            "enum": [
              "server",
              "browser",
              "manual",
              "unavailable"
            ]
          },
          "description": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "group",
          "scope",
          "runner",
          "description"
        ],
        "additionalProperties": true
      },
      "Catalog": {
        "type": "object",
        "properties": {
          "catalog": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Feature"
            }
          },
          "version": {
            "type": "string"
          },
          "mediaServerEnabled": {
            "const": false
          }
        },
        "required": [
          "catalog",
          "version",
          "mediaServerEnabled"
        ],
        "additionalProperties": true
      },
      "LabResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "passed",
              "failed"
            ]
          },
          "detail": {
            "type": "string"
          },
          "durationMs": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "id",
          "status",
          "detail",
          "durationMs"
        ],
        "additionalProperties": true
      },
      "LabReport": {
        "type": "object",
        "properties": {
          "runId": {
            "type": "string",
            "format": "uuid"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": "string",
            "format": "date-time"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LabResult"
            }
          },
          "scope": {
            "const": "console-live-diagnostics"
          }
        },
        "required": [
          "runId",
          "startedAt",
          "completedAt",
          "results",
          "scope"
        ],
        "additionalProperties": true
      },
      "UserCreate": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_.-]{2,63}$"
          },
          "password": {
            "type": "string",
            "format": "password",
            "description": "12–256 UTF-16 units"
          },
          "role": {
            "enum": [
              "admin",
              "operator",
              "viewer"
            ]
          },
          "package_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "username",
          "password",
          "role"
        ],
        "additionalProperties": false
      },
      "UserUpdate": {
        "type": "object",
        "properties": {
          "role": {
            "enum": [
              "admin",
              "operator",
              "viewer"
            ]
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ]
          },
          "package_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "role",
          "status",
          "package_id"
        ],
        "additionalProperties": false
      },
      "PackageInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "price_minor": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100000000
          },
          "currency": {
            "enum": [
              "TRY",
              "USD",
              "EUR"
            ]
          },
          "billing_period": {
            "enum": [
              "monthly",
              "yearly"
            ]
          },
          "room_limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "capacity": {
            "type": "integer",
            "minimum": 2,
            "maximum": 500
          },
          "status": {
            "enum": [
              "active",
              "archived"
            ]
          }
        },
        "required": [
          "name",
          "description",
          "price_minor",
          "currency",
          "billing_period",
          "room_limit",
          "capacity",
          "status"
        ],
        "additionalProperties": false
      }
    }
  }
}
