{"info":{"_postman_id":"e026deb7-3365-470b-840f-24e0fe0c371d","name":"Master Backend","description":"<html><head></head><body><p>The Master Server is a robust and scalable Rust-based server designed to handle user requests, host a database, and perform various other functions essential for your application's backend operations. It communicates seamlessly with the Agent Server to ensure efficient data management and processing. This project leverages Docker for containerization, enabling easy deployment and management of services.</p>\n<h1 id=\"response-types\">Response types</h1>\n<ul>\n<li>Success response:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"string\",\n    \"data\": \"optional_object\",\n}\n\n</code></pre>\n<ul>\n<li>Error response:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"string\",\n    \"error\": \"ErrorCode\"\n}\n\n</code></pre>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[{"content":"Response types","slug":"response-types"}],"owner":"33614625","collectionId":"e026deb7-3365-470b-840f-24e0fe0c371d","publishedId":"2sA3kaDz7A","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-09-09T16:43:00.000Z"},"item":[{"name":"auth","item":[{"name":"Sign up","event":[{"listen":"test","script":{"id":"cb2c5317-afe5-404d-9e55-0aab04fcab7a","exec":["const response = pm.response.json()\r","pm.environment.set(\"access_token\", response.data.access_token)\r","pm.environment.set(\"refresh_token\", response.data.refresh_token)"],"type":"text/javascript","packages":{}}}],"id":"8de41417-b01c-4344-b08e-cc252e02ffec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"test@email.com\",\r\n    \"password\": \"1234\",\r\n    \"device\": {\r\n        \"name\": \"android 1111\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-up","description":"<p>This endpoint is used to sign up a new user.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p><code>email</code> (string, required): The email of the user.</p>\n</li>\n<li><p><code>password</code> (string, required): The password for the user account.</p>\n</li>\n<li><p><code>device</code> (object, required): Information about the user's device.</p>\n<ul>\n<li><p><code>name</code> (string, required): The name of the device.</p>\n</li>\n<li><p><code>os</code> (string, required): The operating system of the device.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p>OS variants:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-typescript\">enum OS {\n    Windows,\n    Linux,\n    MacOS,\n    Android,\n    IOS,\n    Unknown, \n}\n\n</code></pre>\n<h3 id=\"response---201\">Response - 201</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": {\n      \"access_token\": \"jwt\",\n      \"refresh_token\": \"jwt\"\n    },\n    \"message\": \"Signed up successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>409 - <code>UserExists</code></p>\n<p>422 - <code>SerializationError</code></p>\n","urlObject":{"path":["auth","sign-up"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"1b8911b9-bc94-4fbb-8fa2-7960444255f1","name":"201 - Signed up successfully","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"test3@email.com\",\r\n    \"password\": \"1234\",\r\n    \"device\": {\r\n        \"name\": \"android 1111\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-up"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"604"},{"key":"date","value":"Mon, 29 Jul 2024 16:16:40 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"access_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjIyNzM0MDEsImlhdCI6MTcyMjI2OTgwMSwiZGV2aWNlX2lkIjoiMGY0NzdmMTUtNTMwYy00NTViLTg3MGUtNWM4NTQ5Yjc5MWY0IiwidXNlcl9pZCI6ImU2MTUyMjVjLTE0YzYtNDMxZi1hNWM2LWNlMjkzOWRmNTAyOSJ9.EHzPUYAMYVYQvTB7oQHTIaClxUiJ4I_pSM64EZfQwOw\",\n        \"refresh_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjI4NzQ2MDEsImlhdCI6MTcyMjI2OTgwMSwiZGV2aWNlX2lkIjoiMGY0NzdmMTUtNTMwYy00NTViLTg3MGUtNWM4NTQ5Yjc5MWY0IiwidXNlcl9pZCI6ImU2MTUyMjVjLTE0YzYtNDMxZi1hNWM2LWNlMjkzOWRmNTAyOSJ9.ZaUPx_NqiuaM5JF7vQJpcxIPgWA4as6ffsfbSUzhvXo\"\n    },\n    \"message\": \"Signed up successfully\"\n}"},{"id":"144caa69-19d2-4f32-a8fc-a8f3427e06f0","name":"409 - User already exists","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"test@email.com\",\r\n    \"password\": \"1234\",\r\n    \"device\": {\r\n        \"name\": \"android 1111\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-up"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"61"},{"key":"date","value":"Mon, 29 Jul 2024 16:17:13 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"UserAlreadyExists\",\n    \"message\": \"User already exists\"\n}"},{"id":"bf5f8526-52e2-4df2-ba9e-32128e37e2e4","name":"422 - Serialization error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"michkov.evgeny@gmail.com\",\r\n    \"device\": {\r\n        \"name\": \"android 1111\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-up"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"144"},{"key":"date","value":"Fri, 09 Aug 2024 15:46:56 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"SerializationError\",\n    \"message\": \"Failed to deserialize the JSON body into the target type: missing field `password` at line 7 column 1\"\n}"}],"_postman_id":"8de41417-b01c-4344-b08e-cc252e02ffec"},{"name":"Sign in","event":[{"listen":"test","script":{"id":"2e507813-c574-4229-b9d3-f44398f34a7c","exec":["const response = pm.response.json()\r","pm.environment.set(\"access_token\", response.data.access_token)\r","pm.environment.set(\"refresh_token\", response.data.refresh_token)"],"type":"text/javascript","packages":{}}}],"id":"b05ffb7b-4f0c-44c0-b1d7-4a48ea807ad4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"test@email.com\",\r\n    \"password\": \"1234\",\r\n    \"device\": {\r\n        \"name\": \"android 2222\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-in","description":"<p>This endpoint is used to sign in the user.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p><code>email</code> (string, required): The email of the user.</p>\n</li>\n<li><p><code>password</code> (string, required): The password for the user account.</p>\n</li>\n<li><p><code>device</code> (object, required): Information about the user's device.</p>\n<ul>\n<li><p><code>name</code> (string, required): The name of the device.</p>\n</li>\n<li><p><code>os</code> (string, required): The operating system of the device.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p>OS variants:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-dart\">enum OS {\n    Windows,\n    Linux,\n    MacOS,\n    Android,\n    IOS,\n    Unknown, \n}\n\n</code></pre>\n<h3 id=\"response---200\">Response - 200</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": {\n      \"access_token\": \"jwt\",\n      \"refresh_token\": \"jwt\"\n    },\n    \"message\": \"Signed up successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongPassword</code></p>\n<p>404 - <code>UserNotFound</code></p>\n<p>422 - <code>SerializationError</code></p>\n","urlObject":{"path":["auth","sign-in"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"178ddf28-ad98-4988-89e9-4ae35c3de487","name":"200 - Signed in successfully","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"test@email.com\",\r\n    \"password\": \"1234\",\r\n    \"device\": {\r\n        \"name\": \"android\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-in"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"604"},{"key":"date","value":"Mon, 29 Jul 2024 16:24:09 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"access_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjIyNzM4NTAsImlhdCI6MTcyMjI3MDI1MCwiZGV2aWNlX2lkIjoiMmIzNWM3YjItYzI2Yi00ODQ1LTg5ZTgtMzU1OWFlN2FmM2VlIiwidXNlcl9pZCI6IjZlMmEyYTA0LTA0MmMtNDMyZi05YzFlLWI0ZGRhMThmNGFhZCJ9.4jcB5SK_FXUHYiQrOgXmviTcUyB8uRRBRW3GGzxea0E\",\n        \"refresh_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjI4NzUwNTAsImlhdCI6MTcyMjI3MDI1MCwiZGV2aWNlX2lkIjoiMmIzNWM3YjItYzI2Yi00ODQ1LTg5ZTgtMzU1OWFlN2FmM2VlIiwidXNlcl9pZCI6IjZlMmEyYTA0LTA0MmMtNDMyZi05YzFlLWI0ZGRhMThmNGFhZCJ9.LPdvEaPF0JuVTlaSYADE65-Y44p-Mua58v5zKR-pN1g\"\n    },\n    \"message\": \"Signed in successfully\"\n}"},{"id":"eca3b049-3d84-4c8e-a39c-2b3696498ed5","name":"401 - Wrong password","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"test@email.com\",\r\n    \"password\": \"wrong-password\",\r\n    \"device\": {\r\n        \"name\": \"android\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-in"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"52"},{"key":"date","value":"Mon, 29 Jul 2024 16:26:10 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongPassword\",\n    \"message\": \"Wrong password\"\n}"},{"id":"9b2231be-8178-4c4c-b2d0-91882f0ecaf5","name":"404 - User not found","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"not-found@email.com\",\r\n    \"password\": \"1234\",\r\n    \"device\": {\r\n        \"name\": \"android\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-in"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"51"},{"key":"date","value":"Mon, 29 Jul 2024 16:24:24 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"UserNotFound\",\n    \"message\": \"User not found\"\n}"},{"id":"ea7a0a80-6e38-4d94-a600-0f3978442fbb","name":"422 - Serialization Error","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"michkov.evgeny@gmail.com\",\r\n    \"device\": {\r\n        \"name\": \"android 1111\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/sign-in"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"144"},{"key":"date","value":"Wed, 07 Aug 2024 17:11:02 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"SerializationError\",\n    \"message\": \"Failed to deserialize the JSON body into the target type: missing field `password` at line 7 column 1\"\n}"}],"_postman_id":"b05ffb7b-4f0c-44c0-b1d7-4a48ea807ad4"},{"name":"Authorize","id":"53ec67ab-68ed-4f55-b653-60ba0e66e56d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"code\": \"zuRIyAc3EVia51ikMIQsTBOgRN8gIU\",\r\n    \"provider\": \"Discord\",\r\n    \"device\": {\r\n        \"name\": \"android 1111\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/authorize","description":"<p>This endpoint is used to authorize the user using OAuth2.0</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p><code>code</code> (string, required): Access code by OAuth provider</p>\n</li>\n<li><p><code>provider</code> (string, required): OAuth provider</p>\n</li>\n<li><p><code>device</code> (object, required): Information about the user's device.</p>\n<ul>\n<li><p><code>name</code> (string, required): The name of the device.</p>\n</li>\n<li><p><code>os</code> (string, required): The operating system of the device.</p>\n</li>\n</ul>\n</li>\n</ul>\n<p>OS variants:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-dart\">enum Provider {\n    Discord,\n    Github,\n    Google\n}\n\n</code></pre>\n<h3 id=\"response---200\">Response - 200</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": {\n      \"access_token\": \"jwt\",\n      \"refresh_token\": \"jwt\"\n    },\n    \"message\": \"Signed up successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>422 - <code>SerializationError</code></p>\n","urlObject":{"path":["auth","authorize"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"ac59ca18-e929-4334-9b95-0651c32dfd99","name":"201 - Authorized successfully","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"code\": \"4/0AcvDMrCvakXwNLHp7nEridcxVtbOaFgQQ_6Jb1w2CUSZQaX_EqlCE9OcheUua8575Xshvw\",\r\n    \"provider\": \"Google\",\r\n    \"device\": {\r\n        \"name\": \"android 1111\",\r\n        \"os\": \"Android\"\r\n    }\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/authorize"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"605"},{"key":"date","value":"Tue, 06 Aug 2024 20:03:59 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"access_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjI5NzgyMzksImlhdCI6MTcyMjk3NDYzOSwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.MxbD93G_M_zqKhYzE9z5f69_3qVft5MqLib_N_ySpx0\",\n        \"refresh_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjM1Nzk0MzksImlhdCI6MTcyMjk3NDYzOSwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.613MPMvX9DWcId7uYxMYjiO5jxsIwZO8H_EL6NjVr1Q\"\n    },\n    \"message\": \"Authorized successfully\"\n}"}],"_postman_id":"53ec67ab-68ed-4f55-b653-60ba0e66e56d"},{"name":"Logout","event":[{"listen":"test","script":{"id":"1d862e33-095f-4d7d-a590-c2d2c6ba9825","exec":["pm.environment.set(\"access_token\", null)\r","pm.environment.set(\"refresh_token\", null)"],"type":"text/javascript","packages":{}}}],"id":"46a16a42-f58e-4ae2-bbab-71e6f7460817","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"POST","header":[],"url":"{{master-backend-url}}/auth/logout","description":"<p>This endpoint is used to logout the user.</p>\n<h3 id=\"response---200\">Response - 200</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Logged out successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n","urlObject":{"path":["auth","logout"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"e28223dc-396e-4c72-a9f9-9447b601b703","name":"200 - Logged out successfully","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"localhost:8080/auth/logout"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"37"},{"key":"date","value":"Mon, 29 Jul 2024 16:27:40 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Logged out successfully\"\n}"},{"id":"30500639-b5be-4886-acb3-d87728de0532","name":"401 - Wrong token","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer some wrong token","type":"text"}],"url":"{{master-backend-url}}/auth/logout"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Mon, 29 Jul 2024 16:28:03 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"}],"_postman_id":"46a16a42-f58e-4ae2-bbab-71e6f7460817"},{"name":"Refresh tokens","event":[{"listen":"test","script":{"id":"b2e5f696-0bca-4e9a-b5b4-5d591a549795","exec":["const response = pm.response.json()\r","pm.environment.set(\"access_token\", response.data.access_token)\r","pm.environment.set(\"refresh_token\", response.data.refresh_token)"],"type":"text/javascript","packages":{}}}],"id":"51bfb857-cbca-468c-96cd-b5f549e53084","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{refresh_token}}"}]},"isInherited":false},"method":"POST","header":[],"url":"{{master-backend-url}}/auth/refresh","description":"<p>This endpoint is used to refresh user tokens.</p>\n<h3 id=\"response\">Response</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": {\n      \"access_token\": \"jwt\",\n      \"refresh_token\": \"jwt\"\n    },\n    \"message\": \"Tokens refreshed successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n","urlObject":{"path":["auth","refresh"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"e82dbc7e-7832-497f-a6c3-03d1de5cc9d5","name":"200 - Tokens refreshed successfully","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"localhost:8080/auth/refresh"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"611"},{"key":"date","value":"Mon, 29 Jul 2024 16:28:28 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"access_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjIyNzQxMDgsImlhdCI6MTcyMjI3MDUwOCwiZGV2aWNlX2lkIjoiNjVlYTE1ZjAtZmU4Yi00NzNiLWE3ZjgtMzc4YWVkMjVmMTMyIiwidXNlcl9pZCI6IjZlMmEyYTA0LTA0MmMtNDMyZi05YzFlLWI0ZGRhMThmNGFhZCJ9.HMFzm9qqCQENlFKCVigmlOjDDpmVwu_BDfoThT9xmpI\",\n        \"refresh_token\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjI4NzUzMDgsImlhdCI6MTcyMjI3MDUwOCwiZGV2aWNlX2lkIjoiNjVlYTE1ZjAtZmU4Yi00NzNiLWE3ZjgtMzc4YWVkMjVmMTMyIiwidXNlcl9pZCI6IjZlMmEyYTA0LTA0MmMtNDMyZi05YzFlLWI0ZGRhMThmNGFhZCJ9.ZNHhHb6aCiVAw6IE__uCG6RnVzz8YHGHo8bVqTTRpis\"\n    },\n    \"message\": \"Tokens refreshed successfully\"\n}"},{"id":"5ee4fc15-e37a-4bd3-b815-29b817eb4e7f","name":"401 - Wrong token","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer some wrong token","type":"text"}],"url":"{{master-backend-url}}/auth/refresh"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Mon, 29 Jul 2024 16:29:00 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"}],"_postman_id":"51bfb857-cbca-468c-96cd-b5f549e53084"},{"name":"Change password","id":"9a525cbc-dc72-4013-84d9-332109943420","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/change-password","description":"<p>This endpoint is used to change user password.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><code>password</code> (string, required): new password</li>\n</ul>\n<h3 id=\"response---200\">Response - 200</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\":  \"Password changed successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n<p>409 - <code>PasswordIsSame</code></p>\n<p>422 - <code>SerializationError</code></p>\n","urlObject":{"path":["auth","change-password"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"0a7f5dde-1c13-47c1-8dca-336c51989a92","name":"200 - Password changed successfully","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"password\": \"123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/change-password"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"43"},{"key":"date","value":"Mon, 29 Jul 2024 16:31:19 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Password changed successfully\"\n}"},{"id":"cc1812b0-67b4-476b-ab01-3ab9354e5616","name":"401 - Wrong token","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer wrong-token","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/change-password"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Mon, 29 Jul 2024 16:29:18 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"},{"id":"5fdf1f85-0d4c-4f39-84e1-3074411d5e99","name":"409 - Password is the same","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/change-password"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"59"},{"key":"date","value":"Mon, 29 Jul 2024 16:30:32 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"PasswordIsSame\",\n    \"message\": \"Password is the same\"\n}"},{"id":"c5585b45-3b8c-438b-bf64-d3566027e356","name":"422 - Serialization error","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/auth/change-password"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"144"},{"key":"date","value":"Sat, 10 Aug 2024 20:08:23 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"SerializationError\",\n    \"message\": \"Failed to deserialize the JSON body into the target type: missing field `password` at line 1 column 2\"\n}"}],"_postman_id":"9a525cbc-dc72-4013-84d9-332109943420"},{"name":"Confirm email","id":"f11e148c-0f2b-4529-a220-3b2f338f6ae4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{master-backend-url}}/auth/confirm-email?token=fb260695-513a-4d26-b380-024d0d21ed0e","description":"<p>This endpoint is used by user in order to confirm email. User gets the link sent to his mail address.</p>\n<h3 id=\"query-parameters\">Query parameters</h3>\n<ul>\n<li><code>token</code> - id of confirmation request</li>\n</ul>\n<h3 id=\"redirect\">Redirect</h3>\n<p>Redirects user to frontend with some parameters:</p>\n<p>todo!: Success or Failed pages</p>\n","urlObject":{"path":["auth","confirm-email"],"host":["{{master-backend-url}}"],"query":[{"key":"token","value":"fb260695-513a-4d26-b380-024d0d21ed0e"}],"variable":[]}},"response":[],"_postman_id":"f11e148c-0f2b-4529-a220-3b2f338f6ae4"}],"id":"cac886e0-7c97-4d12-839a-a67ac70ca386","_postman_id":"cac886e0-7c97-4d12-839a-a67ac70ca386","description":""},{"name":"session","item":[{"name":"Create session","id":"1019329e-1552-4210-9429-23b069c58b19","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"country\": \"UK\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/session","description":"<p>This endpoint is used to create a new session.</p>\n<p><strong>INFO</strong>: Active sessions will automatically close when a new session is created from a different country. Manual closing is no longer required!</p>\n<h3 id=\"request-body\">Request body</h3>\n<ul>\n<li><code>country</code> (string, required): Target session country</li>\n</ul>\n<p>Country variants:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-dart\">enum Country {\n    UK,\n    USA,\n    Germany\n}\n\n</code></pre>\n<h3 id=\"response---201\">Response - 201</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": {\n        \"server_public_key\": \"string\",\n        \"session_id\": \"uuid\",\n        \"user_ip\": \"x.x.x.x\",\n        \"user_private_key\": \"string\",\n        \"wireguard_uri\": \"x.x.x.x:port\"\n    },\n    \"message\": \"Session created successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n<p>422 - <code>SerializationError</code></p>\n","urlObject":{"path":["session"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"9faf7a20-0d39-4735-8d88-853a6e7f0f6a","name":"201 - Session created successfully","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"country\": \"UK\"\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/session"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"297"},{"key":"date","value":"Mon, 29 Jul 2024 16:31:53 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": {\n        \"server_public_key\": \"fPFB9gxN5/zpDlrglf3bdNcZm0JpcaeaddlYjrRUzjU=\",\n        \"session_id\": \"1b144f12-5bc9-4a22-ac1b-c6ed45c0c89e\",\n        \"user_ip\": \"30.0.0.6\",\n        \"user_private_key\": \"qD7vrtfhmQPVvo3G50iJJgfSwPTK+vakkr1Q6ZvXhGc=\",\n        \"wireguard_uri\": \"134.123.210.148:4444\"\n    },\n    \"message\": \"Session created successfully\"\n}"},{"id":"c02776da-a15e-4da2-97d4-43b3d191b091","name":"401 - Wrong token","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Beare some wrong token","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"country\": \"UK\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/session"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Mon, 29 Jul 2024 16:36:11 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"},{"id":"90d0cf69-050c-43f7-805f-cf16fc9cf2a9","name":"422 - Serialization error","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"country\": \"Some unknown country\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/session"},"status":"Unprocessable Entity","code":422,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"208"},{"key":"date","value":"Fri, 09 Aug 2024 16:35:18 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"SerializationError\",\n    \"message\": \"Failed to deserialize the JSON body into the target type: country: unknown variant `Some unknown country`, expected one of `UK`, `USA`, `Germany` at line 2 column 37\"\n}"}],"_postman_id":"1019329e-1552-4210-9429-23b069c58b19"},{"name":"Close session","id":"f1b69976-d582-4d39-88f2-b658f3425563","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"PUT","header":[],"url":"{{master-backend-url}}/session","description":"<p>This endpoint is used to close current session</p>\n<h3 id=\"response---200\">Response - 200</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"message\": \"Closed session successfully\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n<p>404 - <code>SessionNotFound</code></p>\n","urlObject":{"path":["session"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"82c289a6-3af9-4bc7-9fd9-1688f94645de","name":"200 - Closed session successfully","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"localhost:8080/session"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"41"},{"key":"date","value":"Mon, 29 Jul 2024 16:37:03 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Closed session successfully\"\n}"},{"id":"f41843f0-e0a8-4dcf-a4b6-ffd9368a5360","name":"401 - Wrong token","originalRequest":{"method":"PUT","header":[],"url":"{{master-backend-url}}/session"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Mon, 29 Jul 2024 16:37:34 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"},{"id":"b28c09b7-55e0-411c-bb87-fc71b67b67d0","name":"404 - Session not found","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"{{master-backend-url}}/session"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"57"},{"key":"date","value":"Mon, 29 Jul 2024 16:37:09 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"SessionNotFound\",\n    \"message\": \"Session not found\"\n}"}],"_postman_id":"f1b69976-d582-4d39-88f2-b658f3425563"},{"name":"Get history","id":"8663430c-1f1a-4237-9157-ec1b1f6b603f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"{\r\n    \"limit\": 1,\r\n    \"offset\": 0,\r\n    \"countries\": [\"UK\"],\r\n    \"devices\": [\"ba74e85f-2305-4485-9ee4-e7cbc25f3105\"]\r\n}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/session/history","description":"<p>This endpoint is used to fetch the user's session history.</p>\n<h3 id=\"request-body\">Request Body</h3>\n<ul>\n<li><p><code>limit</code> (integer, optional): Specifies the maximum number of sessions to return.</p>\n</li>\n<li><p><code>offset</code> (integer, optional): Specifies the starting point for the sessions returned. Useful for pagination.</p>\n</li>\n<li><p><code>countries</code> (string[], optional): Filters the sessions by the specified countries.</p>\n</li>\n<li><p><code>devices</code> (string[], optional): Filters the sessions by the specified device IDs.</p>\n</li>\n</ul>\n<p>If an empty request body <code>{}</code> is provided, all closed user sessions will be returned.</p>\n<h3 id=\"country-variants\">Country variants</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-dart\">enum Country {\n    UK,\n    USA,\n    Germany\n}\n\n</code></pre>\n<h3 id=\"response---201\">Response - 201</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n    \"data\": [\n        {\n            \"closed_at\": \"2024-08-12T09:32:57.438\",\n            \"country\": \"UK\",\n            \"device_id\": \"ba74e85f-2305-4485-9ee4-e7cbc25f3105\",\n            \"duration\": 5,\n            \"id\": \"2e54a9c5-529b-4999-ace7-6f7ca5d1f65e\",\n            \"opened_at\": \"2024-08-12T09:32:51.695\"\n        }\n    ],\n    \"message\": \"Successfully got session history\"\n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n<p>422 - <code>SerializationError</code></p>\n","urlObject":{"path":["session","history"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"0d6fecde-9554-406d-a799-757621530e1c","name":"200 - Successfully got session history","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"limit\": 1,\r\n    \"offset\": 0,\r\n    \"countries\": [\"UK\"],\r\n    \"devices\": [\"ba74e85f-2305-4485-9ee4-e7cbc25f3105\"]\r\n}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/session/history"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"866"},{"key":"date","value":"Mon, 12 Aug 2024 09:33:36 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": [\n        {\n            \"closed_at\": \"2024-08-12T09:32:57.438\",\n            \"country\": \"UK\",\n            \"device_id\": \"ba74e85f-2305-4485-9ee4-e7cbc25f3105\",\n            \"duration\": 5,\n            \"id\": \"2e54a9c5-529b-4999-ace7-6f7ca5d1f65e\",\n            \"opened_at\": \"2024-08-12T09:32:51.695\"\n        }\n    ],\n    \"message\": \"Successfully got session history\"\n}"},{"id":"963194da-b308-4e61-af62-4a986c0e0e66","name":"200 - Success [empty body]","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"localhost:8080/session/history"},"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json","description":"","type":"text"}],"cookie":[{"expires":"Invalid Date","domain":"","path":""}],"responseTime":null,"body":"{\n    \"data\": [\n        {\n            \"closed_at\": \"2024-08-12T09:32:57.438\",\n            \"country\": \"UK\",\n            \"device_id\": \"ba74e85f-2305-4485-9ee4-e7cbc25f3105\",\n            \"duration\": 5,\n            \"id\": \"2e54a9c5-529b-4999-ace7-6f7ca5d1f65e\",\n            \"opened_at\": \"2024-08-12T09:32:51.695\"\n        },\n        {\n            \"closed_at\": \"2024-08-12T09:33:02.932\",\n            \"country\": \"USA\",\n            \"device_id\": \"ba74e85f-2305-4485-9ee4-e7cbc25f3105\",\n            \"duration\": 5,\n            \"id\": \"a45e5c85-0c6d-48ab-912a-29f08c721097\",\n            \"opened_at\": \"2024-08-12T09:32:57.447\"\n        },\n        {\n            \"closed_at\": \"2024-08-12T09:33:08.343\",\n            \"country\": \"Germany\",\n            \"device_id\": \"ba74e85f-2305-4485-9ee4-e7cbc25f3105\",\n            \"duration\": 5,\n            \"id\": \"434c993a-a2f5-470f-9f77-c022ad120454\",\n            \"opened_at\": \"2024-08-12T09:33:02.940\"\n        },\n        {\n            \"closed_at\": \"2024-08-12T09:33:28.751\",\n            \"country\": \"UK\",\n            \"device_id\": \"ba74e85f-2305-4485-9ee4-e7cbc25f3105\",\n            \"duration\": 20,\n            \"id\": \"c7cff788-38a7-44a1-850b-5241ccda7378\",\n            \"opened_at\": \"2024-08-12T09:33:08.353\"\n        }\n    ],\n    \"message\": \"Successfully got session history\"\n}"},{"id":"7f5e40fb-f718-44dd-9ff5-c364edfd4614","name":"401 - Wrong token","originalRequest":{"method":"GET","header":[],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/session/history"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Mon, 12 Aug 2024 09:34:21 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"}],"_postman_id":"8663430c-1f1a-4237-9157-ec1b1f6b603f"}],"id":"814a5e20-fe45-4202-8cfc-b8e8951b8c7c","_postman_id":"814a5e20-fe45-4202-8cfc-b8e8951b8c7c","description":""},{"name":"device","item":[{"name":"Get devices","id":"0d5dd22e-26ea-4a1f-bb7c-01e748883ff8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"{}","options":{"raw":{"language":"json"}}},"url":"{{master-backend-url}}/device","description":"<p>This endpoint is used to get all user devices</p>\n<h3 id=\"response---200\">Response - 200</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n  \"message\": \"Devices retrieved successfully\",\n  \"data\": [\n    {\n      \"id\": \"some-uuid\",\n      \"name\": \"some-name\",\n      \"os\": \"Android\",\n      \"status\": \"LoggedIn\"\n    },\n    {\n      \"id\": \"some-uuid\",\n      \"name\": \"some-name\",\n      \"os\": \"Windows\",\n      \"status\": \"LoggedOut\"\n    }\n  ]\n}\n\n</code></pre>\n<p>OS variants:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-dart\">enum OS {\n    Windows,\n    Linux,\n    MacOS,\n    Android,\n    IOS,\n    Unknown, \n}\n\n</code></pre>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n","urlObject":{"path":["device"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"7d1bdc83-b6e2-4cba-9e1b-f055db9c5a84","name":"200 - Devices retrieved successfully","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"{{master-backend-url}}/device"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"156"},{"key":"date","value":"Mon, 12 Aug 2024 09:30:59 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"data\": [\n        {\n            \"id\": \"ba74e85f-2305-4485-9ee4-e7cbc25f3105\",\n            \"name\": \"android 1111\",\n            \"os\": \"Android\",\n            \"status\": \"LoggedIn\"\n        }\n    ],\n    \"message\": \"Devices retrieved successfully\"\n}"},{"id":"7d3e8e12-7650-42ec-a2fe-1a5069440759","name":"401 - Wrong token","originalRequest":{"method":"GET","header":[],"url":"{{master-backend-url}}/device"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Mon, 12 Aug 2024 09:30:28 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"}],"_postman_id":"0d5dd22e-26ea-4a1f-bb7c-01e748883ff8"},{"name":"Revoke Device","id":"1e33f052-ed4e-478e-8e2d-953d2d86b7fa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"{{access_token}}"}]},"isInherited":false},"method":"POST","header":[],"url":"{{master-backend-url}}/device/revoke/ba74e85f-2305-4485-9ee4-e7cbc25f3105","description":"<p>This endpoint is used to revoke provided device.</p>\n<h3 id=\"errors\">Errors</h3>\n<p>401 - <code>WrongToken</code></p>\n<p>403 - <code>DeviceSelfRevocation</code></p>\n<p>404 - <code>DeviceNotFound</code></p>\n<p>409 - <code>DeviceAlreadyRevoked</code></p>\n","urlObject":{"path":["device","revoke","ba74e85f-2305-4485-9ee4-e7cbc25f3105"],"host":["{{master-backend-url}}"],"query":[],"variable":[]}},"response":[{"id":"284516f0-e02d-4242-89ee-06dfd343a56d","name":"200 - Device revoked successfully","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"{{master-backend-url}}/device/revoke/ba74e85f-2305-4485-9ee4-e7cbc25f3105"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"41"},{"key":"date","value":"Tue, 13 Aug 2024 11:06:00 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Device revoked successfully\"\n}"},{"id":"a5e90411-9e73-4134-af7c-6d33dfda4524","name":"401 - Wrong token","originalRequest":{"method":"POST","header":[],"url":"{{master-backend-url}}/device/revoke/ba74e85f-2305-4485-9ee4-e7cbc25f3105"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"46"},{"key":"date","value":"Tue, 13 Aug 2024 11:12:55 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"WrongToken\",\n    \"message\": \"Wrong token\"\n}"},{"id":"831c12fc-aa4e-451d-ac16-21f88127237b","name":"403 - Device self revocation","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"{{master-backend-url}}/device/revoke/ba74e85f-2305-4485-9ee4-e7cbc25f3105"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"94"},{"key":"date","value":"Tue, 13 Aug 2024 11:04:48 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"DeviceSelfRevocation\",\n    \"message\": \"Device self revocation. Use /auth/logout instead.\"\n}"},{"id":"d245cb4d-4163-42f4-867b-31cbad7c4cfd","name":"404 - Device not found","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"{{master-backend-url}}/device/revoke/ba74e85f-2305-4485-9ee4-e6cbc25f3105"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"55"},{"key":"date","value":"Tue, 13 Aug 2024 11:06:55 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"DeviceNotFound\",\n    \"message\": \"Device not found\"\n}"},{"id":"dcbde993-4626-4936-b293-e73a8cc1bc11","name":"409 - Device already revoked","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3MjMyMjMwNTAsImlhdCI6MTcyMzIxOTQ1MCwiZGV2aWNlX2lkIjoiYmU2YTg5OWEtMjA0Mi00MjA5LThiYmItMTk1YjFiOTFkMGY4IiwidXNlcl9pZCI6IjNlMGU3ZjE0LTUxODItNGY3Ny05MWEzLWIzYTUyMWVlYjYyMCJ9.VxJbZZkLF6G5a_A44NNS9PiGS94m6TzwNYmx0-uLrPw","type":"text"}],"url":"{{master-backend-url}}/device/revoke/ba74e85f-2305-4485-9ee4-e7cbc25f3105"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[{"key":"content-type","value":"application/json"},{"key":"content-length","value":"67"},{"key":"date","value":"Tue, 13 Aug 2024 11:11:54 GMT"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"DeviceAlreadyRevoked\",\n    \"message\": \"Device already revoked\"\n}"}],"_postman_id":"1e33f052-ed4e-478e-8e2d-953d2d86b7fa"}],"id":"00d89e64-bc9a-4dc6-917e-1675ee0adba9","_postman_id":"00d89e64-bc9a-4dc6-917e-1675ee0adba9","description":""}]}