{"openapi":"3.0.0","servers":[{"description":"Development Server","url":"https://seven-min-development.herokuapp.com/","variables":{"username":{"default":"admin@byjakt.com"},"password":{"default":"Test123!"}}}],"info":{"description":"<i>This documentation describes the backend API for 7min.</i>\n<br><br>\n<h3>Versioning</h3> <p>By default, all requests receive the 1.0 version of the API. We encourage you to explicitly request this version via the Accept header.<p> <p>Example - \"Accept:&nbsp;application/json; version=1.0\"</p>\n<br><br>\n<h3>Schema</h3> <p>All timestamps are returned in ISO 8601 format</p> <p>YYYY-MM-DDTHH:MM:SSZ</p>\n<br><br>\n<h3>Pagination</h3> <p>Requests that return multiple items will be paginated to 30 items by default. You can specify further pages with the \"?page\" parameter. For some resources, you can also set a custom page size up to 1000 with the \"?per_page\" parameter.</p> <p>Note that page numbering is 1-based and that omitting the \"?page\" parameter will return the first page.</p>\n<br><br>\n<h3>Rate Limiting</h3> <p>All the unauthorized urls have a rate limit of 10,000 requests/day/IP. After exceeding the limit, you’ll get \"HTTP TOO MANY REQUESTS\" with status code 429.</p> <p>When this happens you’ll also receive \"X-Throttle-Wait-Seconds:&nbsp;TIME_IN_SECONDS\" header in the response header.</p>\n<br><br>\n<h3>Errors</h3> <p>Errors will be in the following format:</p> <p>{</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;\"error_type\":&nbsp;\"ValidationError\",</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;\"errors\":&nbsp;[</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\"message\":&nbsp;\"Unable to login with provided credentials\"</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p> <p>&nbsp;&nbsp;&nbsp;&nbsp;]</p> <p>}</p>","version":"1.0.0","title":"7min backend API","contact":{"name":"JAKT"}},"tags":[{"name":"Account Management","description":"API calls related to login, registering and authentication"},{"name":"Users","description":"API calls related to the User object"}],"paths":{"/api/auth/login/":{"post":{"tags":["Account Management"],"summary":"Login","operationId":"login","description":"Logs the user in and returns jwt token, with user details.","requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"The email of the User","example":"admin@byjakt.com"},"password":{"example":"Test123!","description":"The user's password"}},"required":["email password"]}}}},"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"token":{"$ref":"#/components/schemas/token"}}}}}},"400":{"description":"Invalid login details"}}}},"/api/auth/registration/":{"post":{"tags":["Account Management"],"summary":"Register","operationId":"registration","description":"Registers the user and returns a jwt token, along with current user details","requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"description":"The email of the User registering","example":"admin@byjakt.com"},"password":{"example":"Test123!","description":"The user's desired password."},"first_name":{"example":"John"},"last_name":{"example":"Doe"}},"required":["email password"]}}}},"responses":{"200":{"description":"success - user created","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"token":{"$ref":"#/components/schemas/token"}}}}}},"400":{"description":"Invalid registration details. Check message"}}}},"/api/token-refresh/":{"post":{"tags":["Account Management"],"summary":"Token Refresh","operationId":"tokenRefresh","description":"To keep an end-user session from expiring, an API client may hit this endpoint with a currently valid token in order to receive a new token that will have the same delta as the original. Tokens may be refreshed continuously in this manner until JWT_REFRESH_DAYS is reached, at which point the user will have to authenticate again.","requestBody":{"content":{"application/json":{"schema":{"properties":{"token":{"description":"The user's current jwt token","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNvbm5vckBieWpha3QuY29tIiwib3JpZ19pYXQiOjE1MTQ5NDA3ODUsImV4cCI6MTUxNTAyNzE4NSwidXNlcl9pZCI6IjY1MTI5YTg3LTk3NTYtNDM4OS1hODllLWZjYmM1MmE1OTYxYyIsImVtYWlsIjoiY29ubm9yQGJ5amFrdC5jb20ifQ.axT4ouaXXwrb0i8D-IqUaAiXzksg6O7PKuAHKoxSMUU"}},"required":["token"]}}}},"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/token"}}}},"400":{"description":"Invalid current token."}}}},"/api/user/password-reset/":{"post":{"tags":["Account Management"],"summary":"Reset user password.","operationId":"resetPassword","description":"Used to reset user password to new generated.","requestBody":{"content":{"application/json":{"schema":{"properties":{"email":{"example":"user@mail.com"}}}}}},"responses":{"200":{"description":"user details","content":{"application/json":{"schema":{"properties":{"result":{"example":"Done"}}}}}},"400":{"description":"Invalid parameter"},"403":{"description":"Cannot edit information for this user"}}}},"/api/user/{user_id}/":{"parameters":[{"in":"path","name":"user_id","schema":{"type":"string","format":"uuid"},"required":true}],"get":{"tags":["Users"],"summary":"Get user information","operationId":"getUser","description":"Used to fetch information about a specific user.\n","responses":{"200":{"description":"user details","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/User"}}}},"403":{"description":"Cannot access information for this user"},"404":{"description":"User does not exist"}}},"put":{"tags":["Users"],"summary":"Edit user information","operationId":"putUser","description":"Used to edit information about a user.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"responses":{"200":{"description":"user details","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/User"}}}},"400":{"description":"Invalid parameter"},"403":{"description":"Cannot edit information for this user"},"404":{"description":"User does not exist"}}}},"/api/user/{user_id}/change_password/":{"parameters":[{"in":"path","name":"user_id","schema":{"type":"string","format":"uuid"},"required":true}],"post":{"tags":["Users"],"summary":"Edit user password","operationId":"changePassword","description":"Used to edit password.","requestBody":{"content":{"application/json":{"schema":{"properties":{"new_password":{"example":"Test123!"}}}}}},"responses":{"200":{"description":"user details","content":{"application/json":{"schema":{"properties":{"result":{"example":"Done"}}}}}},"400":{"description":"Invalid parameter"},"403":{"description":"Cannot edit information for this user"},"404":{"description":"User does not exist"}}}},"/api/tasks/":{"get":{"tags":["Task"],"summary":"Get Tasks list","description":"Auth required.","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"count":{"type":"integer","example":1}}}}}}}},"post":{"tags":["Task"],"summary":"Create Task","description":"Auth required.","requestBody":{"content":{"application/json":{"schema":{"properties":{"text":{"example":"Buy milk"},"order":{"example":10},"is_done":{"example":true},"time_required":{"example":60}},"required":["text","order"]}}}},"responses":{"200":{"description":"success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"400":{"description":"Validation Error"}}}},"/api/tasks/{task_id}/":{"parameters":[{"in":"path","name":"task_id","schema":{"type":"string","format":"uuid"},"required":true}],"get":{"tags":["Task"],"summary":"Get Task information","description":"Used to fetch information about a specific Task.\n","responses":{"200":{"description":"Task details","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/Task"}}}}}},"put":{"tags":["Task"],"summary":"Edit Task information","description":"Used to edit information about a Task.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"responses":{"200":{"description":"Task details","content":{"application/json":{"schema":{"type":"object","$ref":"#/components/schemas/Task"}}}},"400":{"description":"Invalid parameter"},"404":{"description":"Task does not exist"}}},"delete":{"tags":["Task"],"summary":"Delete Task","description":"Used to delete Task.","responses":{"200":{"description":"Task deleted"},"404":{"description":"Task does not exist"}}}},"/api/tasks/list-update/":{"post":{"tags":["Task"],"summary":"Update Tasks list","description":"Is used to reorder list of Tasks. Auth required.\n\nImportant: the order of items in list IS IGNORED. Only “order” values affect to ordering.\n\nRequirements:\n- all Tasks must belong to user\n- each Task object must contain “order” value. Value must be integer <= 32767\n","requestBody":{"content":{"application/json":{"schema":{"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Task"},"example":[{"id":"e41300e7-1318-427e-a4a3-35e827555ba4","order":10},{"id":"d6651946-095c-4f65-acbe-a9ca396c3024","order":20},{"id":"5c3bfae3-adbb-4cb1-9088-a18c21911358","order":30}]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Task"},"example":[{"id":"e41300e7-1318-427e-a4a3-35e827555ba4","order":10,"text":"Buy milk","is_done":true,"time_required":60},{"id":"d6651946-095c-4f65-acbe-a9ca396c3024","order":20,"text":"Make call","is_done":true,"time_required":60},{"id":"5c3bfae3-adbb-4cb1-9088-a18c21911358","order":30,"text":"Make a party","is_done":true,"time_required":60}]}}}}}}}}}},"components":{"schemas":{"token":{"type":"string","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNvbm5vckBieWpha3QuY29tIiwib-3JpZ19pYXQiOjE1MTQ5NDA3ODUsImV4cCI6MTUxNTAyNzE4NSwidXNlcl9pZCI6IjY1MTI5YTg3LTk3NT-YtNDM4OS1hODllLWZjYmM1MmE1OTYxYyIsImVtYWlsIjoiY29ubm9yQGJ5amFrdC5jb20ifQ.axT4ouaXXwrb0i8D-IqUaAiXzksg6O7PKuAHKoxSMUU"},"User":{"type":"object","properties":{"pk":{"type":"string","format":"uuid","example":"d290f1ee-6c54-4b01-90e6-d701748f0851","readOnly":true},"email":{"type":"string","example":"sam_smith@byjakt.com","readOnly":true},"first_name":{"type":"string","example":"Sam","readOnly":false},"last_name":{"type":"string","example":"Smith","readOnly":false},"phone_number":{"type":"string","example":"(541) 754-3010","readOnly":false},"country":{"type":"string","example":"United States","readOnly":false},"state":{"type":"string","example":"New York","readOnly":false},"city":{"type":"string","example":"New York","readOnly":false},"address":{"type":"string","example":"80 Stonybrook Street Staten Island","readOnly":false},"apartment":{"type":"string","example":"777","readOnly":false}}},"Task":{"type":"object","properties":{"id":{"type":"string","format":"uuid","example":"d290f1ee-6c54-4b01-90e6-d701748f0851","readOnly":true},"text":{"type":"string","example":"Buy milk"},"order":{"type":"integer","example":10},"is_done":{"type":"boolean","example":true},"time_required":{"type":"integer","example":60}}}},"securitySchemes":{"jwt":{"type":"http","scheme":"bearer","bearerFormat":"jwt","description":"<h3>JSON Web Token Authorization</h3> <p>Use \"token\" from login API</p> <p>Example - Authorization:&nbsp;jwt TOKEN_HERE</p>"}}}}