{"openapi":"3.0.0","paths":{"/common-data/countries":{"get":{"operationId":"CommonDataController_getCountries","summary":"Get the list of countries that can be used to sign-up a user","parameters":[],"responses":{"200":{"description":"List of countries","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}}},"tags":["Common data"]}},"/auth/sign-up":{"post":{"operationId":"AuthController_signUpUserWithEmail","summary":"Register a user","description":"Registers a user. See [countries list endpoint](#/Common%20data/CommonDataController_getCountries) for the valid countries list","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignUpDto"}}}},"responses":{"201":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSessionDto"}}}},"400":{"description":"Validation failed response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}}},"tags":["Auth"]}},"/auth/sign-in":{"post":{"operationId":"AuthController_signInWithEmail","summary":"Sign in a user using email, password credentials","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCredentialsDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSessionDto"}}}},"400":{"description":"Validation failed response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}}},"tags":["Auth"]}},"/auth/refresh-session":{"post":{"operationId":"AuthController_refresh","summary":"Refresh a user session using a refresh token","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshSessionDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSessionDto"}}}},"400":{"description":"Validation failed response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}},"403":{"content":{"application/json":{"examples":{"ForbiddenException":{"description":"Forbidden","value":{"statusCode":403,"message":"Forbidden","error":"Forbidden"}}},"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":403},"message":{"type":"string","example":"Forbidden"},"error":{"type":"string","example":"Forbidden"}},"required":["statusCode","message"]}}},"description":""},"404":{"content":{"application/json":{"examples":{"NotFoundException":{"description":"Not Found","value":{"statusCode":404,"message":"Not Found","error":"Not Found"}}},"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":404},"message":{"type":"string","example":"Not Found"},"error":{"type":"string","example":"Not Found"}},"required":["statusCode","message"]}}},"description":""}},"tags":["Auth"]}},"/auth/send-verification-email":{"post":{"operationId":"AuthController_sendVerificationEmail","summary":"Sends an email to a user to verify the user's email address","parameters":[],"responses":{"200":{"description":"Verification email successfully sent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}},"400":{"content":{"application/json":{"examples":{"BadRequestException":{"description":"Bad Request","value":{"statusCode":400,"message":"Bad Request","error":"Bad Request"}}},"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":400},"message":{"type":"string","example":"Bad Request"},"error":{"type":"string","example":"Bad Request"}},"required":["statusCode","message"]}}},"description":""},"401":{"content":{"application/json":{"examples":{"UnauthorizedException":{"description":"Unauthorized","value":{"statusCode":401,"message":"Unauthorized","error":"Unauthorized"}}},"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":401},"message":{"type":"string","example":"Unauthorized"},"error":{"type":"string","example":"Unauthorized"}},"required":["statusCode","message"]}}},"description":""},"404":{"content":{"application/json":{"examples":{"NotFoundException":{"description":"Not Found","value":{"statusCode":404,"message":"Not Found","error":"Not Found"}}},"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":404},"message":{"type":"string","example":"Not Found"},"error":{"type":"string","example":"Not Found"}},"required":["statusCode","message"]}}},"description":""}},"tags":["Auth"],"security":[{"bearer":[]}]}},"/auth/verify-email":{"post":{"operationId":"AuthController_verifyEmail","summary":"Verifies user email using a verification token","parameters":[{"name":"token","required":true,"in":"query","description":"Email verificaiton token","schema":{"type":"string"}}],"responses":{"200":{"description":"Email successfully verified","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommonResponseDto"}}}},"400":{"description":"Validation failed response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}},"404":{"content":{"application/json":{"examples":{"NotFoundException":{"description":"Not Found","value":{"statusCode":404,"message":"Not Found","error":"Not Found"}}},"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":404},"message":{"type":"string","example":"Not Found"},"error":{"type":"string","example":"Not Found"}},"required":["statusCode","message"]}}},"description":""}},"tags":["Auth"]}},"/auth/send-password-reset-email":{"post":{"operationId":"AuthController_sendPasswordRestEmail","summary":"Sends an email with password reset insctructions","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailDto"}}}},"responses":{"200":{"description":"Password reset email successfully sent","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CommonResponseDto"}]}}}},"400":{"description":"Validation failed response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}},"404":{"content":{"application/json":{"examples":{"NotFoundException":{"description":"Not Found","value":{"statusCode":404,"message":"Not Found","error":"Not Found"}}},"schema":{"type":"object","properties":{"statusCode":{"type":"number","example":404},"message":{"type":"string","example":"Not Found"},"error":{"type":"string","example":"Not Found"}},"required":["statusCode","message"]}}},"description":""}},"tags":["Auth"]}},"/auth/reset-password":{"post":{"operationId":"AuthController_resetPassword","summary":"Validates the reset token and updates the user's password","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordResetDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CommonResponseDto"}]}}}},"400":{"description":"Validation failed response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}}},"tags":["Auth"]}},"/auth/google-sign-in":{"post":{"operationId":"AuthController_googleSignIn","summary":"Sign in user via google. Also verifies a user email","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleSignInDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSessionDto"}}}},"400":{"description":"Validation failed response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationResponse"}}}}},"tags":["Auth"]}}},"info":{"title":"3Legions auth module API","description":"3Legions auth API documentation","version":"1.0","contact":{}},"tags":[],"servers":[],"components":{"securitySchemes":{"bearer":{"scheme":"bearer","bearerFormat":"JWT","type":"http"}},"schemas":{"SignUpDto":{"type":"object","properties":{"email":{"type":"string","example":"example@mail.test"},"password":{"type":"string"},"country":{"type":"string","description":"Country name","example":"United Kingdom"}},"required":["email","password","country"]},"User":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string","example":"email@mail.test"},"country":{"type":"string","description":"Country name","example":"United Kingdom"},"email_verified_at":{"format":"date-time","type":"string","nullable":true},"created_at":{"format":"date-time","type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","email","country","email_verified_at","created_at","updated_at"]},"UserSessionDto":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"},"access_token":{"type":"string"},"refresh_token":{"type":"string"}},"required":["user","access_token","refresh_token"]},"ValidationErrorDto":{"type":"object","properties":{"property":{"type":"string","example":"email","description":"Name of the field that hasn't passed validation"},"errors":{"description":"Errors list","type":"array","items":{"type":"string"}}},"required":["property","errors"]},"ValidationResponse":{"type":"object","properties":{"statusCode":{"type":"number","default":400},"error":{"type":"string","default":"Validation failed"},"message":{"type":"array","items":{"$ref":"#/components/schemas/ValidationErrorDto"}}},"required":["statusCode","error","message"]},"UserCredentialsDto":{"type":"object","properties":{"email":{"type":"string","example":"example@mail.test"},"password":{"type":"string"}},"required":["email","password"]},"RefreshSessionDto":{"type":"object","properties":{"refresh_token":{"type":"string"}},"required":["refresh_token"]},"CommonResponseDto":{"type":"object","properties":{"statusCode":{"type":"number","example":200},"message":{"type":"string","example":"ok"}},"required":["statusCode","message"]},"EmailDto":{"type":"object","properties":{"email":{"type":"string","example":"example@mail.test"}},"required":["email"]},"PasswordResetDto":{"type":"object","properties":{"password":{"type":"string"},"token":{"type":"string","description":"Password reset token"}},"required":["password","token"]},"GoogleSignInDto":{"type":"object","properties":{"tokenId":{"type":"string","description":"Token id received from google sign-in on the client side."}},"required":["tokenId"]}}}}