{
  "openapi": "3.1.0",
  "info": {
    "title": "NODARA Seller API",
    "version": "1.0",
    "description": "NODARA 0.9.4.2 RC. Scoped seller tokens; see https://docs.nodara.store/ for permissions and queued states."
  },
  "paths": {
    "/api/integration/v1/account": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Account",
        "operationId": "account_api_integration_v1_account_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "SellerBearer": []
          }
        ]
      }
    },
    "/api/integration/v1/options": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Options",
        "operationId": "options_api_integration_v1_options_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "SellerBearer": []
          }
        ]
      }
    },
    "/api/integration/v1/users": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Users",
        "operationId": "users_api_integration_v1_users_get",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Q"
            }
          },
          {
            "name": "panel_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Panel Id"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Create",
        "operationId": "create_api_integration_v1_users_post",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVPN"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/users/{uid}": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "User",
        "operationId": "user_api_integration_v1_users__uid__get",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/users/{uid}/refresh": {
      "post": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Refresh",
        "operationId": "refresh_api_integration_v1_users__uid__refresh_post",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/users/{uid}/action": {
      "post": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Action",
        "operationId": "action_api_integration_v1_users__uid__action_post",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SellerAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/users/{uid}/transfer": {
      "post": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Transfer",
        "operationId": "transfer_api_integration_v1_users__uid__transfer_post",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferInput"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Transfer Status",
        "operationId": "transfer_status_api_integration_v1_users__uid__transfer_get",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/users/{uid}/history": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "History",
        "operationId": "history_api_integration_v1_users__uid__history_get",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "uid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Uid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/requests/{key}": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Request Status",
        "operationId": "request_status_api_integration_v1_requests__key__get",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/ledger": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Ledger",
        "operationId": "ledger_api_integration_v1_ledger_get",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "After Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/integration/v1/events": {
      "get": {
        "tags": [
          "Seller integration"
        ],
        "summary": "Events",
        "operationId": "events_api_integration_v1_events_get",
        "security": [
          {
            "SellerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "after_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "After Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CreateVPN": {
        "properties": {
          "panel_id": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Panel Id"
          },
          "owner_id": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Owner Id"
          },
          "username": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_]{3,32}$",
            "title": "Username"
          },
          "group_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Group Ids"
          },
          "quota_gib": {
            "type": "integer",
            "maximum": 1000000.0,
            "minimum": 1.0,
            "title": "Quota Gib"
          },
          "days": {
            "type": "integer",
            "maximum": 36500.0,
            "minimum": 1.0,
            "title": "Days"
          },
          "on_hold": {
            "type": "boolean",
            "title": "On Hold",
            "default": false
          },
          "note": {
            "type": "string",
            "maxLength": 500,
            "title": "Note",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "panel_id",
          "username",
          "group_ids",
          "quota_gib",
          "days"
        ],
        "title": "CreateVPN"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "SellerAction": {
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "edit_note",
              "set_quota",
              "renew",
              "change_group",
              "disable",
              "enable",
              "reset_usage",
              "revoke_subscription",
              "delete"
            ],
            "title": "Action"
          },
          "quota_gib": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 1000000.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Quota Gib"
          },
          "days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 36500.0,
                "minimum": 1.0
              },
              {
                "type": "null"
              }
            ],
            "title": "Days"
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "group_ids": {
            "anyOf": [
              {
                "items": {
                  "type": "integer"
                },
                "type": "array",
                "maxItems": 100,
                "minItems": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Group Ids"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "action"
        ],
        "title": "SellerAction"
      },
      "TransferInput": {
        "properties": {
          "panel_id": {
            "type": "integer",
            "exclusiveMinimum": 0.0,
            "title": "Panel Id"
          },
          "group_ids": {
            "items": {
              "type": "integer"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Group Ids"
          },
          "username": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_]{3,32}$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Username"
          }
        },
        "type": "object",
        "required": [
          "panel_id",
          "group_ids"
        ],
        "title": "TransferInput"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "SellerBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "servers": [
    {
      "url": "https://panel.nodara.store:8443"
    }
  ]
}
