{"swagger":"2.0","info":{"version":"v3","title":"AlphaAntiLeak API","description":"This is the public and private AlphaAntiLeak API documentation\n\nYou can authorize your app over 'https://alphaantileak.net/login.html?oauth&perms=PERMISSION_LEVEL_HERE&redirect=callbackurl.com/login?session=SESSION' (URL Encoded)\n\nYou can find our permission levels here (bitfield encoded as signed 64 bit integer):\n0x0000000000000001 -> GET_USER_INFO\n0x0000000000000002 -> GET_MAIL\n0x0000000000000004 -> GET_OWNED_APPS\n0x0000000000000008 -> SPEND_MONEY\n0x0000000000000010 -> LAUNCH_APPS\n0x0000000000000020 -> MODIFY_APPS\n0x0000000000000040 -> MODIFY_ACCOUNT\n0x0000000000000080 -> ACCEPT_TOS\n0x0000000000000100 -> GET_APP_INFO\n0xFFFFFFFFFFFFFFFF -> All Permissions (-1)\nhttps://en.wikipedia.org/wiki/Bit_field\n"},"securityDefinitions":{"SessionKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"tags":[{"name":"public"},{"name":"private"}],"security":[{"SessionKeyAuth":[]}],"paths":{"/users/{username}/balance/add/{balance}":{"post":{"summary":"Adds/removes money to a user","description":"","tags":["private"],"parameters":[{"in":"path","name":"username","description":"Username of the credited user","type":"string","required":true},{"in":"path","name":"balance","description":"Balance to add in cent, use Balance*(-1) to remove balance","type":"integer","required":true}],"responses":{"200":{"description":"OK"}}}},"/user/logout":{"post":{"summary":"Invalidates current session","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"UNAUTHORIZED [The session provided doesn't exist]"}}}},"/users/login/valid":{"get":{"summary":"Checks if current session is valid.","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"401":{"description":"UNAUTHORIZED [The session provided doesn't exist or is lacking permission]"}}}},"/users/self/mail/reverify":{"post":{"summary":"Resends Verification Mail.","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"409":{"description":"CONFLICT [E-Mail already verified]"},"429":{"description":"TOO MANY REQUESTS [Try again later]"}}}},"/users/self/mail":{"put":{"summary":"Changes current E-Mail.","description":"","tags":["public"],"consumes":["application/json"],"parameters":[{"in":"body","name":"mail","description":"Your new mail","schema":{"type":"object","required":["mail"],"properties":{"mail":{"type":"string","example":"admin@alphaantileak.net"}}}}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"400":{"description":"BAD REQUEST [Invalid E-Mail]"},"403":{"description":"FORBIDDEN [Only Authtype Mail is allowed for this Request | E-Mail already taken]"},"409":{"description":"CONFLICT [E-Mail didn't change]"},"429":{"description":"TOO MANY REQUESTS [Try again later]"}}}},"/users/self/name":{"put":{"summary":"Changes current Username","description":"","tags":["public"],"consumes":["application/json"],"parameters":[{"in":"body","name":"name","description":"Your new username","schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","example":"SuperName"}}}}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"400":{"description":"BAD REQUEST [Invalid Username]"},"403":{"description":"FORBIDDEN [Only non anonymous accounts are allowed for this Request]"},"409":{"description":"CONFLICT [Username didn't change or is already taken]"},"429":{"description":"TOO MANY REQUESTS [You can only change your username once per 14 days]"}}}},"/users/self/info":{"get":{"summary":"Gets user info","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/User"}}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/users/self/mailprefs":{"post":{"summary":"Updates user mail preferences","description":"","tags":["public"],"consumes":["application/json"],"parameters":[{"in":"body","name":"body","required":true,"schema":{"$ref":"#/definitions/MailConfig"}}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/users/self/apps":{"get":{"summary":"Gets info about the user's owned apps","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/Subscription"}}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/users/self/tos/accept":{"get":{"summary":"Accepts the ToS","description":"This endpoint should ONLY be used by the account owner","tags":["private"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/apps/create":{"post":{"summary":"Creates an App","description":"This will remove balance from your account","tags":["public"],"responses":{"200":{"description":"OK","schema":{"properties":{"id":{"type":"string","description":"The id of the newly created app"}}}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"},"402":{"description":"PAYMENT REQUIRED [Not enough balance]"}}}},"/apps/{app-id}":{"delete":{"summary":"Deletes an app","description":"Please use this with caution. We can't restore a deleted app.","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"403":{"description":"FORBIDDEN [Not app owner OR App not expired]"}}}},"/apps/{app-id}/info":{"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"get":{"summary":"Gets basic app and classpath info","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/App"}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}},"post":{"summary":"Changes app settings","description":"","tags":["public"],"parameters":[{"in":"body","name":"body","description":"All fields are optional","schema":{"$ref":"#/definitions/AppUpdate"}}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"400":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/apps/{app-id}/analytics/launches":{"post":{"summary":"Gets launch statistics","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true},{"in":"body","name":"body","schema":{"type":"object","properties":{"from":{"type":"integer","example":1517250719231,"description":"Time in ms since start of unix epoch"},"to":{"type":"integer","example":1517343305951,"description":"Time in ms since start of unix epoch"},"resolution":{"type":"integer","example":3600,"description":"Data time resolution in seconds"}}}}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"properties":{"from":{"type":"string","example":"Jan 23, 2018 8:36:22 PM"},"to":{"type":"string","example":"Jan 23, 2018 9:36:22 PM"},"data":{"properties":{"SUCCESS":{"type":"integer","example":0,"description":"Successful launches"},"FAIL_HWID":{"type":"integer","example":0,"description":"Failure: Unauthorized Hardware Identification"},"FAIL_OS":{"type":"integer","example":0,"description":"Failure: Unsupported OS"}}}}}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/apps/{app-id}/analytics/live":{"get":{"summary":"Gets live user count","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"properties":{"users":{"type":"integer","example":0}}}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/apps/{app-id}/icon":{"get":{"summary":"Gets the app icon (binary)","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"responses":{"200":{"description":"OK (Responds with binary-data)"},"404":{"description":"NOT FOUND"}}}},"/apps/perms":{"get":{"summary":"Gets available Application Permissions","description":"","tags":["public"],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"properties":{"id":{"type":"integer","example":1},"title":{"type":"string","example":"Add user"},"desc":{"type":"string","example":"Allows to add users to your application"}}}}}}}},"/apps/{app-id}/managers":{"post":{"summary":"Adds/Removes/Modifies a manager to/from/of a application","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true},{"in":"body","name":"body","schema":{"type":"object","properties":{"name":{"type":"string","example":"SaubereSache"},"perms":{"type":"array","example":[0,2,5],"description":"If you want to remove a manger leave the brackets empty","items":{"properties":{"perm":{"type":"integer","example":0}}}}}}}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/Manager"}},"401":{"description":"UNAUTHORIZED [Invalid session]"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/apps/{app-id}/users":{"get":{"summary":"Gets info about all users having this app","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/UserInfo"}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/apps/{app-id}/add":{"post":{"summary":"Adds yourself to the specified app if enabled by app owner.","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"403":{"description":"FORBIDDEN | The app owner doesn't allow you to add yourself"},"409":{"description":"CONFLICT | You are already added to this application"}}}},"/apps/{app-id}/users/{username}":{"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true},{"in":"path","name":"username","description":"The name of the user","type":"string","required":true}],"get":{"summary":"Gets info about the user regarding app","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/UserInfo"}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"},"404":{"description":"NOT FOUND [User doesn't have app]"}}},"delete":{"summary":"Removes user from app","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"404":{"description":"NOT FOUND [User doesn't have app]"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}},"post":{"summary":"Adds user to app","description":"","parameters":[{"in":"body","name":"body","required":true,"schema":{"properties":{"time":{"type":"integer","example":600000,"description":"Time in ms the user should own the app [optional]"}}}}],"tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"404":{"description":"NOT FOUND [User not registered]"},"409":{"description":"CONFLICT [User already has app]"},"400":{"description":"BAD REQUEST [User limit reached (paid plan only)]"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}},"put":{"summary":"Modifies an app user (reset hardware lock)","description":"","parameters":[{"in":"body","name":"body","required":true,"schema":{"properties":{"reset-hwid":{"type":"boolean","example":true}}}}],"tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"404":{"description":"NOT FOUND [User doesn't have app]"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}},"/apps/{app-id}/extend":{"get":{"summary":"Extends an app","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"404":{"description":"NOT FOUND [App is free and cannot be extended]"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"},"402":{"description":"PAYMENT REQUIRED [Insufficient Balance]"}}}},"/apps/{app-id}/upgrade":{"get":{"summary":"Upgrades an app's plan","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"404":{"description":"NOT FOUND [App is free and cannot be upgraded]"},"403":{"description":"FORBIDDEN [Insufficient Permissions]"},"402":{"description":"PAYMENT REQUIRED [Insufficient Balance]"}}}},"/apps/{app-id}/downgrade":{"get":{"summary":"Downgrades an app's plan","description":"","tags":["public"],"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true}],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK"},"404":{"description":"NOT FOUND [App is free and cannot be downgraded or app is at minimum plan]"},"403":{"description":"FORBIDDEN [Insufficient Permissions OR Too many users for downgrade]"}}}},"/apps/{app-id}/audit_log/{page}":{"parameters":[{"in":"path","name":"app-id","description":"The ID of the app","type":"string","required":true},{"in":"path","name":"page","description":"The page you want to access","type":"string","required":true}],"get":{"summary":"Gets the audit log, starting with page 1","description":"","tags":["public"],"security":[{"SessionKeyAuth":[]}],"responses":{"200":{"description":"OK","schema":{"properties":{"username":{"type":"string","example":"SaubereSache"},"time":{"type":"integer","example":1512774510589,"description":"Ms since begin of unix epoch"},"data":{"type":"string","example":"Uploaded new File for Classpath entry main","description":"Text of user action"}}}},"403":{"description":"FORBIDDEN [Insufficient Permissions]"}}}}},"definitions":{"User":{"type":"object","properties":{"id":{"type":"string","example":"bbb35ed3-7d59-4787-b464-e23a9e5f163e"},"name":{"type":"string","example":"SaubereSache"},"balance":{"type":"integer","example":1337},"can-change-mail":{"type":"boolean","example":true},"mail":{"type":"string","example":"admin@alphaantileak.net"},"mail-verified":{"type":"boolean","example":false},"is-admin":{"type":"boolean","example":false},"tos":{"type":"boolean","example":true},"mail-config":{"$ref":"#/definitions/MailConfig"}}},"MailConfig":{"type":"object","properties":{"login-notification":{"type":"boolean","example":true},"newsletter":{"type":"boolean","example":true},"api-newsletter":{"type":"boolean","example":false},"user-name-change-notification":{"type":"boolean","example":false}}},"Subscription":{"type":"object","properties":{"app-uuid":{"type":"object","properties":{"owns":{"type":"boolean","example":false},"manage":{"type":"boolean","example":false},"name":{"type":"string","example":"Test Application"},"version":{"type":"string","example":"v0.1"},"expires":{"type":"integer","example":1512823537360,"description":"Optional. Milliseconds since unix epoch; expire date for this subscription"},"app-disabled":{"type":"boolean","example":false},"app-expired":{"type":"boolean","example":false},"app-flagged":{"type":"boolean","example":false},"app-free-plan":{"type":"boolean","example":false}}}}},"App":{"type":"object","properties":{"name":{"type":"string","example":"Test Application"},"img":{"type":"boolean","example":true,"description":"Tells you if the app has an icon"},"version":{"type":"string","example":"v0.1"},"main-class":{"type":"string","example":"de.sauberesache.project.Main"},"main-method":{"type":"string","example":"main"},"hwid-protection":{"type":"boolean","example":true},"vm-protection":{"type":"boolean","example":true},"vpn-protection":{"type":"boolean","example":false},"hide-console":{"type":"boolean","example":true},"platform-win-x86":{"type":"boolean","example":false},"platform-win-x64":{"type":"boolean","example":true},"platform-mac-x86":{"type":"boolean","example":false},"platform-mac-x64":{"type":"boolean","example":false},"platform-linux-x86":{"type":"boolean","example":false},"protection-mode":{"type":"string","example":"NORMAL"},"expires":{"type":"integer","example":1512243144987,"description":"Ms since start of unix epoch. If your app uses the free plan this field is missing"},"plan":{"type":"integer","example":1,"description":"If your app uses the free plan this field is missing"},"devices-per-user":{"type":"integer","example":1,"maximum":20},"block-artificial-input":{"type":"boolean","example":false},"class-path":{"type":"string","example":"['dep-name', 'dep-name-2', 'dep-name-3]"},"managers":{"$ref":"#/definitions/Manager"}}},"Manager":{"type":"object","properties":{"id":{"type":"string","description":"The manager-uuid"},"username":{"type":"string","example":"SaubereSache"},"perms":{"type":"integer","example":1,"description":"See /apps/perms for permission explaination"}}},"UserInfo":{"type":"object","properties":{"user-id":{"type":"string","example":"e305fc1f-7b80-4286-86c9-5eee2599fe84","description":"Unique ID of the user in UUID format"},"username":{"type":"string","example":"SaubereSache"},"hwid":{"type":"integer","example":1,"description":"Number of devices which are hwid locked. Max device count can be changed"},"first-launch":{"type":"integer","example":1512260964381,"description":"Can be missing if userd never launched. Time in ms since start of unix epoch"},"last-launch":{"type":"integer","example":1512260964381,"description":"Can be missing if user never launched. Time in ms since start of unix epoch"},"expire":{"type":"integer","example":1512260954381,"description":"Can be missing if the subscription isn't temporary. Time in ms since start of unix epoch"}}},"AppUpdate":{"type":"object","properties":{"name":{"type":"string","example":"Test Application"},"icon":{"type":"string","description":"Base64 PNG"},"version":{"type":"string","example":"v0.1"},"main-class":{"type":"string","example":"de.sauberesache.project.Main"},"main-method":{"type":"string","example":"main"},"hwid-protection":{"type":"boolean","example":true},"vm-protection":{"type":"boolean","example":true},"vpn-protection":{"type":"boolean","example":false},"hide-console":{"type":"boolean","example":true},"platform-win-x86":{"type":"boolean","example":false},"platform-win-x64":{"type":"boolean","example":true},"platform-mac-x86":{"type":"boolean","example":false},"platform-mac-x64":{"type":"boolean","example":false},"platform-linux-x86":{"type":"boolean","example":false},"protection-mode":{"type":"string","example":"NORMAL"},"devices-per-user":{"type":"integer","example":1,"maximum":20},"block-artificial-input":{"type":"boolean","example":false}}}},"schemes":["https","http"],"host":"alphaantileak.net","basePath":"/api/v3"}