{"openapi":"3.1.0","info":{"title":"Reseller Panel API","version":"1.0.0"},"paths":{"/api/health":{"get":{"tags":["Health"],"summary":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/upstream/health":{"get":{"tags":["Health"],"summary":"Upstream Health","operationId":"upstream_health_api_upstream_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/auth/login":{"post":{"tags":["Authentication"],"summary":"Login","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Login"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"tags":["Authentication"],"summary":"Logout","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/me":{"get":{"tags":["Authentication"],"summary":"Me","operationId":"me_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/dashboard":{"get":{"tags":["Dashboard"],"summary":"Dashboard","operationId":"dashboard_api_dashboard_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]}},"/api/resellers":{"get":{"tags":["Resellers"],"summary":"Resellers","operationId":"resellers_api_resellers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["Resellers"],"summary":"Create Reseller","operationId":"create_reseller_api_resellers_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewReseller"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/resellers/{reseller_id}":{"patch":{"tags":["Resellers"],"summary":"Update Reseller","operationId":"update_reseller_api_resellers__reseller_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reseller_id","in":"path","required":true,"schema":{"type":"integer","title":"Reseller Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditReseller"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/resellers/{reseller_id}/credit":{"post":{"tags":["Resellers"],"summary":"Credit","operationId":"credit_api_resellers__reseller_id__credit_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reseller_id","in":"path","required":true,"schema":{"type":"integer","title":"Reseller Id"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ledger":{"get":{"tags":["Dashboard"],"summary":"Ledger List","operationId":"ledger_list_api_ledger_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/inbounds":{"get":{"tags":["Locations"],"summary":"Inbound Settings","operationId":"inbound_settings_api_settings_inbounds_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reseller_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Reseller Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Locations"],"summary":"Update Inbound Settings","operationId":"update_inbound_settings_api_settings_inbounds_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reseller_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Reseller Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundSelection"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/inbounds/refresh":{"post":{"tags":["Locations"],"summary":"Refresh Inbounds","operationId":"refresh_inbounds_api_settings_inbounds_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyMutation"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/location-labels":{"get":{"tags":["Locations"],"summary":"Location Labels","operationId":"location_labels_api_location_labels_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reseller_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Reseller Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["Locations"],"summary":"Update Location Labels","operationId":"update_location_labels_api_location_labels_patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"reseller_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Reseller Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationLabels"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users":{"get":{"tags":["Users"],"summary":"Users","operationId":"users_api_users_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"reseller_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"title":"Reseller Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["Users"],"summary":"Create User","operationId":"create_user_api_users_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"idempotency-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewUser"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/{user_id}/traffic":{"post":{"tags":["Users"],"summary":"Add Traffic","operationId":"add_traffic_api_users__user_id__traffic_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtraTraffic"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/{user_id}/rotate-subscription":{"post":{"tags":["Users"],"summary":"Rotate Subscription","operationId":"rotate_subscription_api_users__user_id__rotate_subscription_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyMutation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/{user_id}/rotate-connection":{"post":{"tags":["Users"],"summary":"Rotate Connection","operationId":"rotate_connection_api_users__user_id__rotate_connection_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}},{"name":"idempotency-key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Idempotency-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmptyMutation"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/{user_id}":{"patch":{"tags":["Users"],"summary":"Rename User","operationId":"rename_user_api_users__user_id__patch","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenameUser"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Users"],"summary":"User Detail","operationId":"user_detail_api_users__user_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Users"],"summary":"Delete User","operationId":"delete_user_api_users__user_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/users/{user_id}/sync":{"post":{"tags":["Users"],"summary":"Sync User","operationId":"sync_user_api_users__user_id__sync_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/keys":{"get":{"tags":["API keys"],"summary":"Keys","operationId":"keys_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["API keys"],"summary":"Create Key","operationId":"create_key_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewKey"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/keys/{key_id}":{"delete":{"tags":["API keys"],"summary":"Revoke Key","operationId":"revoke_key_api_keys__key_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"integer","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Credit":{"properties":{"amount_gb":{"type":"integer","maximum":100000000.0,"minimum":1.0,"title":"Amount Gb"},"note":{"type":"string","maxLength":240,"title":"Note","default":""}},"additionalProperties":false,"type":"object","required":["amount_gb"],"title":"Credit"},"EditReseller":{"properties":{"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"},"name":{"anyOf":[{"type":"string","maxLength":80,"minLength":1},{"type":"null"}],"title":"Name"},"password":{"anyOf":[{"type":"string","maxLength":256,"minLength":12},{"type":"null"}],"title":"Password"}},"additionalProperties":false,"type":"object","title":"EditReseller"},"EmptyMutation":{"properties":{},"additionalProperties":false,"type":"object","title":"EmptyMutation"},"ExtraTraffic":{"properties":{"extra_gb":{"type":"integer","maximum":49.0,"minimum":1.0,"title":"Extra Gb"}},"additionalProperties":false,"type":"object","required":["extra_gb"],"title":"ExtraTraffic"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InboundSelection":{"properties":{"inbound_ids":{"items":{"type":"integer"},"type":"array","maxItems":64,"minItems":1,"title":"Inbound Ids"},"primary_id":{"type":"integer","minimum":1.0,"title":"Primary Id"}},"additionalProperties":false,"type":"object","required":["inbound_ids","primary_id"],"title":"InboundSelection"},"LocationLabel":{"properties":{"inbound_id":{"type":"integer","minimum":1.0,"title":"Inbound Id"},"template":{"type":"string","maxLength":120,"title":"Template"}},"additionalProperties":false,"type":"object","required":["inbound_id","template"],"title":"LocationLabel"},"LocationLabels":{"properties":{"labels":{"items":{"$ref":"#/components/schemas/LocationLabel"},"type":"array","maxItems":64,"title":"Labels"}},"additionalProperties":false,"type":"object","required":["labels"],"title":"LocationLabels"},"Login":{"properties":{"username":{"type":"string","maxLength":48,"minLength":1,"title":"Username"},"password":{"type":"string","maxLength":256,"minLength":1,"title":"Password"}},"additionalProperties":false,"type":"object","required":["username","password"],"title":"Login"},"NewKey":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"NewKey"},"NewReseller":{"properties":{"username":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_.-]{2,47}$","title":"Username"},"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"},"password":{"type":"string","maxLength":256,"minLength":12,"title":"Password"},"quota_gb":{"type":"integer","maximum":100000000.0,"minimum":0.0,"title":"Quota Gb"}},"additionalProperties":false,"type":"object","required":["username","name","password","quota_gb"],"title":"NewReseller"},"NewUser":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"},"volume_gb":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Volume Gb"},"duration_months":{"type":"integer","maximum":5.0,"minimum":1.0,"title":"Duration Months","default":1},"reseller_id":{"anyOf":[{"type":"integer","minimum":1.0},{"type":"null"}],"title":"Reseller Id"}},"additionalProperties":false,"type":"object","required":["name","volume_gb"],"title":"NewUser"},"RenameUser":{"properties":{"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"}},"additionalProperties":false,"type":"object","required":["name"],"title":"RenameUser"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","description":"API key created in /api/keys. Browser sessions use rp_session instead.","scheme":"bearer"}}}}