{"openapi":"3.0.0","info":{"version":"1.0","title":"1.0","contact":{"name":"contact@mediascout.co","email":"vlad@mediascout.co","url":"https://mediascout.co"}},"paths":{"/api/login":{"post":{"summary":"Logs in the user","description":"Logs in the user","tags":["user"],"parameters":[{"name":"X-CSRF-TOKEN","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"204":{"description":"The login was successful"},"419":{"description":"CSRF token missing or incorrect","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"CSRF token mismatch","description":"CSRF token mismatch"}}}}}},"422":{"description":"The login failed. See errors.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message describing why the login failed"},"errors":{"type":"object","description":"The list of errors describing why the login failed","properties":{"email":{"type":"array","items":{"type":"string","example":"Invalid email"},"description":"Optional errors for the email"},"password":{"type":"array","items":{"type":"string","example":"Invalid password"},"description":"Optional errors for the password"}}}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Server error","description":"Server error"}}}}}}}}},"/api/logout":{"post":{"summary":"Logs out the user","description":"Login user","tags":["user"],"parameters":[{"name":"X-CSRF-TOKEN","in":"header","schema":{"type":"string"}}],"responses":{"204":{"description":"The login was successful"},"401":{"description":"User is not logged in","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Unauthenticated user","description":"Message describing why the logout failed"}}}}}},"419":{"description":"CSRF token missing or incorrect","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"CSRF token mismatch","description":"CSRF token mismatch"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Server error","description":"Server error"}}}}}}}}},"/api/register":{"post":{"summary":"Register a new user","description":"Register a new user","tags":["user"],"parameters":[{"name":"X-CSRF-TOKEN","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterRequest"}}}},"responses":{"201":{"description":"The registration was successful"},"419":{"description":"CSRF token missing or incorrect","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"CSRF token mismatch","description":"CSRF token mismatch"}}}}}},"422":{"description":"The login failed. See errors.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message describing why the login failed"},"errors":{"type":"object","description":"The list of errors describing why the login failed","properties":{"first_name":{"type":"array","items":{"type":"string","example":"Invalid first name"},"description":"Optional errors for the first name"},"last_name":{"type":"array","items":{"type":"string","example":"Invalid last_name"},"description":"Optional errors for the last_name"},"email":{"type":"array","items":{"type":"string","example":"Invalid email"},"description":"Optional errors for the email"},"password":{"type":"array","items":{"type":"string","example":"Invalid password"},"description":"Optional errors for the password"},"password_confirmation":{"type":"array","items":{"type":"string","example":"The password confirmation does not match"},"description":"Optional errors for the password confirmation"}}}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Server error","description":"Server error"}}}}}}}}},"/api/password/email":{"post":{"summary":"Send reset password email","description":"Send reset password email","tags":["user","password"],"parameters":[{"name":"X-CSRF-TOKEN","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResetPasswordEmailRequest"}}}},"responses":{"200":{"description":"The password reset link has been emailed","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"We have emailed your password reset link!","description":"Message confirming that the email containing password reset link has been sent"}}}}}},"419":{"description":"CSRF token missing or incorrect","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"CSRF token mismatch","description":"CSRF token mismatch"}}}}}},"422":{"description":"Invalid email. See errors.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message describing why the reset password failed"},"errors":{"type":"object","description":"The list of errors describing why the reset password","properties":{"email":{"type":"array","items":{"type":"string","example":"Invalid email"},"description":"Optional errors for the email"}}}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Server error","description":"Server error"}}}}}}}}},"/password/reset":{"get":{"summary":"Set a new password for user","description":"Set a new password for user","tags":["user","password"],"parameters":[{"name":"token","in":"path","description":"Password request unique token identifier","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The request is valid. Waiting for new password to be set"}}}},"/api/password/reset":{"post":{"summary":"Set a new password for user","description":"Set a new password for user","tags":["user","password"],"parameters":[{"name":"X-CSRF-TOKEN","in":"header","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}}},"responses":{"200":{"description":"The new password has been saved","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Your password has been reset!","description":"Message confirming that new password has been saved"}}}}}},"419":{"description":"CSRF token missing or incorrect","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"CSRF token mismatch","description":"CSRF token mismatch"}}}}}},"422":{"description":"The password reset has failed. See errors.","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Message describing why the reset password failed"},"errors":{"type":"object","description":"The list of errors describing why the reset password","properties":{"token":{"type":"array","items":{"type":"string","example":"The token field is required"},"description":"Optional errors for the token"},"email":{"type":"array","items":{"type":"string","example":"The email field is required"},"description":"Optional errors for the email"},"password":{"type":"array","items":{"type":"string","example":"The password field is required"},"description":"Optional errors for the password"},"password_confirmation":{"type":"array","items":{"type":"string","example":"The password confirmation does not match"},"description":"Optional errors for the password"}}}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Server error","description":"Server error"}}}}}}}}},"/api/auth/google":{"get":{"summary":"Get redirect url for login/signup google with google","tags":["user","password"],"parameters":[{"name":"X-CSRF-TOKEN","in":"header","schema":{"type":"string"}}],"responses":{"200":{"description":"The new password has been saved","content":{"application/json":{"schema":{"type":"object","properties":{"redirectUrl":{"type":"string","description":"Google url to redirect to"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Server error","description":"Server error"}}}}}}}}},"/auth/google/callback":{"get":{"summary":"Page containing the login with Google results","tags":["user","password"],"responses":{"200":{"description":"The new password has been saved","content":{"application/json":{"schema":{"type":"object","properties":{"redirect_url":{"type":"string","description":"Url to redirect the user to after the login"}}}}}},"500":{"description":"Server error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","example":"Server error","description":"Server error"}}}}}}}}}},"components":{"schemas":{"LoginRequest":{"properties":{"email":{"type":"string","example":"john.doe@mediascout.co"},"password":{"type":"string","example":"some very complex password"},"remember":{"type":"boolean"}},"required":["email","password"]},"RegisterRequest":{"properties":{"first_name":{"type":"string","example":"John"},"last_name":{"type":"string","example":"Doe"},"email":{"type":"string","example":"john.doe@mediascout.co"},"password":{"type":"string","example":"some very complex password"},"password_confirmation":{"type":"string","example":"some very complex password"}},"required":["first_name","last_name","email","password","password_confirmation"]},"SendResetPasswordEmailRequest":{"properties":{"email":{"type":"string","example":"john.doe@mediascout.co"}},"required":["email"]},"ResetPasswordRequest":{"properties":{"token":{"type":"string","example":"02e4f9ff335161d66994fb1867f7eaa946ccdefca5ee32bb5e9fe2a019f2e4a1"},"email":{"type":"string","example":"john.doe@mediascout.co"},"password":{"type":"string","example":"some very complex password"},"password_confirmation":{"type":"string","example":"some very complex password"}},"required":["email","password","password_confirm"]},"User":{"properties":{"id":{"type":"integer"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name"]}}}}